Class ARPlaneMeshGenerators
Generator functions for ARPlane mesh geometery.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Syntax
public static class ARPlaneMeshGenerators
Remarks
These static class provides ways to generate different parts of plane geometry, such as vertices, indices, normals and UVs. You can use these functions to build an ARPlane Mesh object.
Methods
GenerateIndices(List<Int32>, List<Vector3>, Single)
Declaration
public static bool GenerateIndices(List<int> indices, List<Vector3> convexPolygon, float areaTolerance = 1E-06F)
Parameters
Type | Name | Description |
---|---|---|
List<System.Int32> | indices | |
List<Vector3> | convexPolygon | |
System.Single | areaTolerance |
Returns
Type | Description |
---|---|
System.Boolean |
GenerateMesh(Mesh, Pose, Vector3, Vector3, List<Vector3>, Single)
Generates a Mesh
from the given parameters. The convexPolygon is assumed to be convex.
Declaration
public static bool GenerateMesh(Mesh mesh, Pose pose, Vector3 center, Vector3 normal, List<Vector3> convexPolygon, float areaTolerance = 1E-06F)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | The |
Pose | pose | The |
Vector3 | center | The plane's center, in plane-space. |
Vector3 | normal | The plane's normal, in plane-space. |
List<Vector3> | convexPolygon | The vertices of the plane's boundary, in plane-space. |
System.Single | areaTolerance | If any triangle in the generated mesh is less than this, then the entire mesh is ignored. This handles an edge case which prevents degenerate or very small triangles. Units are meters-squared. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
convexPolygon is not checked for its convexness. Concave polygons will produce incorrect results.
GenerateUvs(List<Vector2>, Pose, Vector3, List<Vector3>)
Declaration
public static void GenerateUvs(List<Vector2> Uvs, Pose pose, Vector3 normal, List<Vector3> vertices)
Parameters
Type | Name | Description |
---|---|---|
List<Vector2> | Uvs | |
Pose | pose | |
Vector3 | normal | |
List<Vector3> | vertices |