public bool Equals(BSHalfEdge right) { if (right == null) { return(false); } return(Vertices[0] == right.Vertices[0] && Vertices[1] == right.Vertices[1] && Vertices[2] == right.Vertices[2]); }
public BSTriangle(BSPoint A, BSPoint B) { Vertices[0] = A; Vertices[1] = B; Vertices[2] = B; Center = (A.Position + B.Position) / 2.0f; Vertices[0].AddTriangle(this); Vertices[1].AddTriangle(this); Vertices[2].AddTriangle(this); // now create edges, this should be in the CCW order Edges[0] = new BSHalfEdge(Vertices[0], Vertices[1]); Edges[1] = new BSHalfEdge(Vertices[1], Vertices[2]); Edges[2] = new BSHalfEdge(Vertices[2], Vertices[0]); }
//public static bool operator ==(BSTriangle left, BSTriangle right) //{ // return (left.Vertices[0] == right.Vertices[0] && left.Vertices[1] == right.Vertices[1] && left.Vertices[2] == right.Vertices[2]); //} //public static bool operator !=(BSTriangle left, BSTriangle right) //{ // return !(left.Vertices[0] == right.Vertices[0] && left.Vertices[1] == right.Vertices[1] && left.Vertices[2] == right.Vertices[2]); //} //public BSTriangle(BSTriangle Copy) //{ // //FMemory::Memcpy(Vertices, Copy.Vertices); // //FMemory::Memcpy(Edges, Copy.Edges); // //Center = Copy.Center; // //Vertices[0]->AddTriangle(this); // //Vertices[1]->AddTriangle(this); // //Vertices[2]->AddTriangle(this); //} public BSTriangle(BSPoint A, BSPoint B, BSPoint C) { Vertices[0] = A; Vertices[1] = B; Vertices[2] = C; Center = (A.Position + B.Position + C.Position) / 3.0f; Vertices[0].AddTriangle(this); Vertices[1].AddTriangle(this); Vertices[2].AddTriangle(this); // when you make triangle first time, make sure it stays in CCW MakeCCW(); // now create edges, this should be in the CCW order Edges[0] = new BSHalfEdge(Vertices[0], Vertices[1]); Edges[1] = new BSHalfEdge(Vertices[1], Vertices[2]); Edges[2] = new BSHalfEdge(Vertices[2], Vertices[0]); }
public bool DoesShare(BSHalfEdge A) { return(Vertices[0] == A.Vertices[1] && Vertices[1] == A.Vertices[0]); }