docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetFaceMesh

    GetFaceMesh(TrackableId, Allocator, ref XRFaceMesh)

    Get the mesh data associated with the face with faceId. The faceMesh should be reused if it is the correct size; otherwise, its arrays should be reallocated with allocator. Use Resize(int, int, Attributes, Allocator) to resize the containers for face mesh data.

    Declaration
    public virtual void GetFaceMesh(TrackableId faceId, Allocator allocator, ref XRFaceMesh faceMesh)
    Parameters
    Type Name Description
    TrackableId faceId

    The TrackableId for a XRFace.

    Allocator allocator

    The allocator to use for the returned data if a resize is necessary.

    XRFaceMesh faceMesh

    The container for the mesh data to either re-use or re-allocate.

    Examples
    var vertices = faceMesh.vertices;
    CreateOrResizeNativeArrayIfNecessary(numVertices, allocator, ref vertices);
    
    ...
    
    faceMesh.Assign(new XRFaceMesh
    {
        vertices = vertices,
        indices = ...
    });
    In This Article
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Friday, September 22, 2023