Class XRFaceSubsystem.Provider | AR Subsystems | 3.1.10
docs.unity3d.com
    Show / Hide Table of Contents

    Class XRFaceSubsystem.Provider

    Class to be implemented by an implementor of the XRFaceSubsystem.

    Inheritance
    Object
    XRFaceSubsystem.Provider
    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    protected abstract class Provider

    Properties

    maximumFaceCount

    Get or set the maximum number of faces the subsystem should attempt to track simultaneously. Defaults to 1.

    Declaration
    public virtual int maximumFaceCount { get; set; }
    Property Value
    Type Description
    Int32

    supportedFaceCount

    Should return the maximum number of faces the subsystem is able to track simultaneously. Defaults to 1.

    Declaration
    public virtual int supportedFaceCount { get; }
    Property Value
    Type Description
    Int32

    Methods

    Destroy()

    Called by when the subsystem is destroyed.

    Declaration
    public virtual void Destroy()

    GetChanges(XRFace, Allocator)

    Get the changes (added, updated, and removed) faces since the last call to .

    Declaration
    public abstract TrackableChanges<XRFace> GetChanges(XRFace defaultFace, Allocator allocator)
    Parameters
    Type Name Description
    XRFace defaultFace

    The default face. This should be used to initialize the returned NativeArrays for backwards compatibility. See TrackableChanges(Void*, Int32, Void*, Int32, Void*, Int32, T, Int32, Allocator).

    Allocator allocator

    An Allocator to use when allocating the returned NativeArrays.

    Returns
    Type Description
    TrackableChanges<XRFace>

    TrackableChanges<T> describing the faces that have been added, updated, and removed since the last call to . The changes should be allocated using allocator.

    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 to ensure unused NativeArrays are disposed properly and to resize individual arrays.

    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 = ...
    });

    Start()

    Called by . Only invoked if not already running.

    Declaration
    public virtual void Start()

    Stop()

    Called by . Only invoked if current running.

    Declaration
    public virtual void Stop()
    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