Class TriangleOnModuleFaceDetector
Class holding methods for checking if triangles are on any of a module's faces.
Any tris that are on one of a module's faces can cause the importer to miscalculate the corner contents and the face-face connections.
Inheritance
Inherited Members
Namespace: CarbideFunction.Wildtile.Editor
Syntax
public static class TriangleOnModuleFaceDetector
Methods
AreFloatsEqualOnFace(Single, Single)
Returns true if offsetFromOrigin
is close enough to faceOffset
to be considered on the face.
Declaration
public static bool AreFloatsEqualOnFace(float left, float right)
Parameters
Type | Name | Description |
---|---|---|
System.Single | left | |
System.Single | right |
Returns
Type | Description |
---|---|
System.Boolean |
FindAndReportFacesOnModuleBoundsFace(Vector3[], Int32[], SubMeshDescriptor, Vector3, TriangleOnModuleFaceDetector.OnFoundFaceOnModuleBoundsFace)
This method finds all faces that lie on the tile's boundaries, calling reporterCallable
if/when it finds one.
Declaration
public static void FindAndReportFacesOnModuleBoundsFace(Vector3[] vertices, int[] indexBuffer, SubMeshDescriptor subMesh, Vector3 dimensions, TriangleOnModuleFaceDetector.OnFoundFaceOnModuleBoundsFace reporterCallable)
Parameters
Type | Name | Description |
---|---|---|
Vector3[] | vertices | |
System.Int32[] | indexBuffer | Indices for drawing polygons on the face. This is known as triangles in Unity's Mesh class. |
SubMeshDescriptor | subMesh | The sub mesh to check. This must have triangle topology. |
Vector3 | dimensions | |
TriangleOnModuleFaceDetector.OnFoundFaceOnModuleBoundsFace | reporterCallable |
Remarks
The mesh-related vertices
, indexBuffer
, and subMesh
parameters are used instead of Unity's Mesh class because this allows for optimisations as repeated accesses (e.g. mesh.vertices
) allocate and populate a new array for each access.