Hello, currently i'm using unity to develop a game in c#...
Basically i have 2 triangles with random positions in a 3d space...
These triangles have and index and array of their vertices positions, so...
public class Triangle
{
public int index;
public Vector3[] _transform = new Vector3[3];
}
when i create the 2 triangle objects i would like to check if they are neighbours, meaning if they have 2 vertices in commun, then i would like to save their indexes and the 2 coincident points so...
public class TriPairs
{
public Vector2Int pair;
public Vector3[] points = new Vector3[2];
}
i tried making a nested for loop for comparison but it just increases in complexity when trying to compare and extract the points, any ideas?
Thanks in advance