Class ModelTileConnectivityCalculator.VertexContentsInferenceDiagnostics
This abstract class is an interface to receive calculation diagnostics. GetConnectivityFromPrefab(GameObject, Single, Single, List<MaterialImportSettings>, ModelTileConnectivityCalculator.VertexContentsInferenceDiagnostics) calls the methods while calculating the connectivity.
Inheritance
Inherited Members
Namespace: CarbideFunction.Wildtile.Editor
Syntax
public abstract class VertexContentsInferenceDiagnostics
Methods
GetVertexPosition(Int32)
This user-callable function converts the vertexIndex parameter into a position on the unit cube. This is intended to be called within the abstract methods on this class, which all pass in the vertex index.
Declaration
public static Vector3 GetVertexPosition(int vertexIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vertexIndex | Which cube corner is currently being processed. Should be the value of the vertexIndex parameter from implemented versions of abstract methods on this class. |
Returns
Type | Description |
---|---|
Vector3 |
OnCubeCornerEvaluated(Int32, Int32)
Called at the end of evaluating a single cube corner.
Declaration
public abstract void OnCubeCornerEvaluated(int vertexIndex, int insideness)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vertexIndex | Which cube corner is currently being processed |
System.Int32 | insideness | How "inside" is the cube corner in the mesh. A value of 0 indicates this cube corner is outside, and a value of 1 indicates this cube corner is inside. Other values can be found if the model is non-manifold, which is not supported by the calculator |
OnFirstTriSelected(Int32, Triangle, Boolean)
For each face, either this or OnNoValidTrianglesForVertex(Int32) will be called at the start of processing.
This method is called if, when searching a mesh, a triangle that is non-coplanar with the cube corner is found. The triangle will be used as the source of the insideness ray.
Declaration
public abstract void OnFirstTriSelected(int vertexIndex, Triangle tri, bool isClockwise)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vertexIndex | Which cube corner is currently being processed |
Triangle | tri | The triangle that has been selected as the insideness ray source |
System.Boolean | isClockwise | Whether this triangle has clockwise winding. This is used to bias the insideness ray when it is cast through the model |
OnNoValidTrianglesForVertex(Int32)
Called if there are no triangles in the mesh, or if all the triangles that are in the mesh are coplanar with the current cube corner.
Declaration
public abstract void OnNoValidTrianglesForVertex(int vertexIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vertexIndex | Which cube corner is currently being processed |
OnTriCrossed(Int32, Triangle, Boolean)
Called between calls to OnFirstTriSelected(Int32, Triangle, Boolean) and OnCubeCornerEvaluated(Int32, Int32) is called.
This will be called if the insideness ray hits this triangle. If the ray missed this triangle, it would call OnTriCrossed(Int32, Triangle, Boolean) instead.
Declaration
public abstract void OnTriCrossed(int vertexIndex, Triangle tri, bool isClockwise)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vertexIndex | Which cube corner is currently being processed |
Triangle | tri | The triangle that the insideness ray hit |
System.Boolean | isClockwise | Whether the insideness ray hit the triangle with a clockwise winding |
OnTriMissed(Int32, Triangle)
Called between calls to OnFirstTriSelected(Int32, Triangle, Boolean) and OnCubeCornerEvaluated(Int32, Int32) is called.
This will be called if the insideness ray misses this triangle. If the ray hit this triangle, it would call OnTriCrossed(Int32, Triangle, Boolean) instead.
Declaration
public abstract void OnTriMissed(int vertexIndex, Triangle tri)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vertexIndex | Which cube corner is currently being processed |
Triangle | tri | The triangle that the insideness ray missed |