Class ARPlaneMeshVisualizer
Generates a mesh for an ARPlane.
Inheritance
Namespace: UnityEngine.XR.ARFoundation
Syntax
public sealed class ARPlaneMeshVisualizer : MonoBehaviour
Remarks
If this GameObject has a MeshFilter and/or MeshCollider,
this component will generate a mesh from the underlying BoundedPlane.
It will also update a LineRenderer with the boundary points, if present.
Properties
mesh
Get the Mesh that this visualizer creates and manages.
Declaration
public Mesh mesh { get; }
Property Value
| Type | Description |
|---|---|
| Mesh |
Methods
GenerateMesh(Mesh, Vector3, Vector3, List<Vector3>, Single)
Generates a Mesh from the given parameters. The convexPolygon is assumed to be convex.
Declaration
public static void GenerateMesh(Mesh mesh, Vector3 center, Vector3 normal, List<Vector3> convexPolygon, float areaTolerance = 1E-06F)
Parameters
| Type | Name | Description |
|---|---|---|
| Mesh | mesh | 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. |
Remarks
convexPolygon is not checked for its convexness. Concave polygons will produce incorrect results.