docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRFaceSubsystem.Provider

    Class to be implemented by an implementor of the XRFaceSubsystem.

    Inheritance
    object
    SubsystemProvider
    SubsystemProvider<XRFaceSubsystem>
    XRFaceSubsystem.Provider
    Inherited Members
    SubsystemProvider<XRFaceSubsystem>.TryInitialize()
    SubsystemProvider<XRFaceSubsystem>.Start()
    SubsystemProvider<XRFaceSubsystem>.Stop()
    SubsystemProvider<XRFaceSubsystem>.Destroy()
    SubsystemProvider.running
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    public abstract class XRFaceSubsystem.Provider : SubsystemProvider<XRFaceSubsystem>

    Properties

    currentMaximumFaceCount

    Gets the maximum number of faces the provider will track.

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

    requestedMaximumFaceCount

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

    Declaration
    public virtual int requestedMaximumFaceCount { get; set; }
    Property Value
    Type Description
    int
    Exceptions
    Type Condition
    NotSupportedException

    Thrown if the requested maximum face count is greater than one, but the subsystem does not support tracking multiple faces.

    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
    int

    Methods

    GetChanges(XRFace, Allocator)

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

    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*, int, void*, int, void*, int, T, int, 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 GetChanges(XRFace, Allocator). 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 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 © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)