Skip to main content

QuadTriangulationToolLogic.Triangle

A private struct in Root.Township, the global namespace. Reach it through att-stubs' publicized assemblies or Harmony's AccessTools.

Private triangle used by QuadTriangulationToolLogic, holding vertex indices and positions plus its normal and centroid.

Constructors​

MemberWhat it is
Triangle(Vector3[] vertices, int[] triangles, int start)Creates a QuadTriangulationToolLogic.Triangle from sharedVertices, uniqueVertices, sharedIndices, uniqueIndices and index.
Triangle(List<Vector3> sharedVertices, List<Vector3> uniqueVertices, List<int> sharedIndices, List<int> uniqueIndices, int index)Creates a QuadTriangulationToolLogic.Triangle from sharedVertices, uniqueVertices, sharedIndices, uniqueIndices and index.

Fields​

MemberWhat it is
Vector3 centroidCentre point of the triangle.
int[] indicesThe three vertex indices.
Vector3 normalFace normal from the winding order.
Vector3[] verticesThe three vertex positions.

Methods​

MemberWhat it is
static void GetInverted(ref QuadTriangulationToolLogic.Triangle abc, ref QuadTriangulationToolLogic.Triangle def)Re-splits a quad's two triangles along the other diagonal and makes them face outward.
2 private and internal methods
MemberWhat it is
private static QuadTriangulationToolLogic.Triangle Flip(QuadTriangulationToolLogic.Triangle original)Returns the triangle with reversed winding and normal.
private static void Split(QuadTriangulationToolLogic.Triangle from, QuadTriangulationToolLogic.Triangle other, List<int> sharedIndices, List<int> uniqueIndices, List<Vector3> sharedVertices, List<Vector3> uniqueVertices)Sorts the other triangle's vertices into ones shared with this triangle and ones unique to it.