docs.unity3d.com
    Show / Hide Table of Contents

    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
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: UnityEngine.XR.ARSubsystems
    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 readonly NativeArray<int> indices { get; }
    Property Value
    Type Description
    Unity.Collections.NativeArray<Int32>

    normals

    The normals in the mesh. This is a parallel array to vertices and uvs.

    Declaration
    public readonly NativeArray<Vector3> normals { get; }
    Property Value
    Type Description
    Unity.Collections.NativeArray<UnityEngine.Vector3>

    uvs

    The texture coordinates for the mesh. This is a parallel array to vertices and normals.

    Declaration
    public readonly NativeArray<Vector2> uvs { get; }
    Property Value
    Type Description
    Unity.Collections.NativeArray<UnityEngine.Vector2>

    vertices

    The vertices in the mesh. This is a parallel array to normals and uvs.

    Declaration
    public readonly NativeArray<Vector3> vertices { get; }
    Property Value
    Type Description
    Unity.Collections.NativeArray<UnityEngine.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()
    Implements
    IDisposable.Dispose()

    Equals(Object)

    Tests for equality.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The object to compare against.

    Returns
    Type Description
    Boolean

    True if obj is of type XRFaceMesh and Equals(XRFaceMesh) also returns true; otherwise false.

    Overrides
    ValueType.Equals(Object)

    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
    Boolean

    True if every field in other is equal to this XRFaceMesh, otherwise false.

    Implements
    IEquatable<T>.Equals(T)

    GetHashCode()

    Generates a hash suitable for use with containers like HashSet and Dictionary.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code generated from this object's fields.

    Overrides
    ValueType.GetHashCode()

    Resize(Int32, Int32, XRFaceMesh.Attributes, Allocator)

    Resize the NativeArrays held by this struct. This method will deallocate the NativeArrays 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 NativeArrays. 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
    Int32 vertexCount

    The number of vertices in the mesh.

    Int32 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.

    Unity.Collections.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
    ValueType.ToString()

    Operators

    Equality(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
    Boolean

    True if lhs is equal to rhs, otherwise false.

    Inequality(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
    Boolean

    True if lhs is not equal to rhs, otherwise false.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023