I’m trying to find the immediate neighbors of a clicked triangle in a mesh, those that share a side (and two vertices.) To do this I find the coordinates of the vertexes of the clicked triangle and assign them to the Vector3’s v1, v2, and v3. Then I start a loop to go through all of the other triangles on the mesh, one at a time, storing their vertexes to v4, v5, and v6.
I only move on to the next step if any two of those points match so I wrote this monstrosity:
if ((v1==v4 && v2 == v5)||(v1==v4 && v2 == v6)|| (v1 == v4 && v3==v5) || (v1 == v4 && v3==v6) || (v1 == v5 && v2 == v4) || (v1 == v5 && v2 == v6) || (v1 == v5 && v3 == v4) || (v1 == v5 && v3 == v6) || (v1 == v6 && v2 == v4) || (v1 == v6 && v2==v5) || (v1 == v6 && v3==v4) || (v1 == v6 && v3==v6))
The code doesn’t run to completion and debugging shows me this line is never executed, or if it is it doesn’t finish. I’m assuming this syntax is a no-go (this being said I don’t get an error). How would you write it?