Struct XRFaceMesh
Container for mesh data associated with an XRFace. Not all implementations
support all data. Check for existence with NativeArray
's IsCreated
property.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public struct XRFaceMesh : IEquatable<XRFaceMesh>, IDisposable
Properties
indices
The triangle indices of the mesh. There are three times as many indices as triangles.
Declaration
public NativeArray<int> indices { get; }
Property Value
Type | Description |
---|---|
NativeArray<int> |
normals
Declaration
public NativeArray<Vector3> normals { get; }
Property Value
Type | Description |
---|---|
NativeArray<Vector3> |
uvs
Declaration
public NativeArray<Vector2> uvs { get; }
Property Value
Type | Description |
---|---|
NativeArray<Vector2> |
vertices
Declaration
public NativeArray<Vector3> vertices { get; }
Property Value
Type | Description |
---|---|
NativeArray<Vector3> |
Methods
Dispose()
Disposes of the all four native arrays: vertices, normals, uvs, and indices. Checking for creation before calling Dispose.
Declaration
public void Dispose()
Equals(object)
Tests for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The |
Returns
Type | Description |
---|---|
bool |
|
Overrides
Equals(XRFaceMesh)
Tests for equality.
Declaration
public bool Equals(XRFaceMesh other)
Parameters
Type | Name | Description |
---|---|---|
XRFaceMesh | other | The other XRFaceMesh to compare against. |
Returns
Type | Description |
---|---|
bool |
|
GetHashCode()
Generates a hash suitable for use with containers like HashSet
and Dictionary
.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code generated from this object's fields. |
Overrides
Resize(int, int, Attributes, Allocator)
Resize the NativeArray
s held by this struct. This method will deallocate
the NativeArray
s if they are not needed or if they are not the correct size.
If they are already the correct size, this method does not mutate those NativeArray
s.
This facilitate memory reuse when the number of vertices or triangles in the face does
not change frequently.
Declaration
public void Resize(int vertexCount, int triangleCount, XRFaceMesh.Attributes attributes, Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
int | vertexCount | The number of vertices in the mesh. |
int | triangleCount | The number of triangles in the mesh. |
XRFaceMesh.Attributes | attributes | Optional mesh attributes. This affects whether normals and uvs will be (re)allocated or disposed. |
Allocator | allocator | If a reallocation is required, this allocator will be used. |
ToString()
Generates a string suitable for debugging purposes.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string representation of this XRFaceMesh. |
Overrides
Operators
operator ==(XRFaceMesh, XRFaceMesh)
Tests for equality. Same as Equals(XRFaceMesh).
Declaration
public static bool operator ==(XRFaceMesh lhs, XRFaceMesh rhs)
Parameters
Type | Name | Description |
---|---|---|
XRFaceMesh | lhs | The left-hand side of the comparison. |
XRFaceMesh | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|
operator !=(XRFaceMesh, XRFaceMesh)
Tests for inequality. Same as !
Equals(XRFaceMesh).
Declaration
public static bool operator !=(XRFaceMesh lhs, XRFaceMesh rhs)
Parameters
Type | Name | Description |
---|---|---|
XRFaceMesh | lhs | The left-hand side of the comparison. |
XRFaceMesh | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|