docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRFaceSubsystem

    An abstract class that provides a generic API for low-level face tracking features.

    Inheritance
    object
    SubsystemWithProvider
    SubsystemWithProvider<XRFaceSubsystem, XRFaceSubsystemDescriptor, XRFaceSubsystem.Provider>
    TrackingSubsystem<XRFace, XRFaceSubsystem, XRFaceSubsystemDescriptor, XRFaceSubsystem.Provider>
    XRFaceSubsystem
    Implements
    ISubsystem
    Inherited Members
    TrackingSubsystem<XRFace, XRFaceSubsystem, XRFaceSubsystemDescriptor, XRFaceSubsystem.Provider>.GetChanges(Allocator)
    SubsystemWithProvider<XRFaceSubsystem, XRFaceSubsystemDescriptor, XRFaceSubsystem.Provider>.OnCreate()
    SubsystemWithProvider<XRFaceSubsystem, XRFaceSubsystemDescriptor, XRFaceSubsystem.Provider>.OnStart()
    SubsystemWithProvider<XRFaceSubsystem, XRFaceSubsystemDescriptor, XRFaceSubsystem.Provider>.OnStop()
    SubsystemWithProvider<XRFaceSubsystem, XRFaceSubsystemDescriptor, XRFaceSubsystem.Provider>.OnDestroy()
    SubsystemWithProvider<XRFaceSubsystem, XRFaceSubsystemDescriptor, XRFaceSubsystem.Provider>.subsystemDescriptor
    SubsystemWithProvider<XRFaceSubsystem, XRFaceSubsystemDescriptor, XRFaceSubsystem.Provider>.provider
    SubsystemWithProvider.Start()
    SubsystemWithProvider.OnStart()
    SubsystemWithProvider.Stop()
    SubsystemWithProvider.OnStop()
    SubsystemWithProvider.Destroy()
    SubsystemWithProvider.OnDestroy()
    SubsystemWithProvider.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 class XRFaceSubsystem : TrackingSubsystem<XRFace, XRFaceSubsystem, XRFaceSubsystemDescriptor, XRFaceSubsystem.Provider>, ISubsystem
    Remarks

    Use this class to access face tracking features in your app via accessing the generic API. You can also extend it to provide an implementation of a provider which provides the face tracking data to the higher-level code.

    Constructors

    XRFaceSubsystem()

    Constructs a face subsystem. Do not invoked directly; call Create on the XRFaceSubsystemDescriptor instead.

    Declaration
    public XRFaceSubsystem()

    Properties

    currentMaximumFaceCount

    Get the maximum number of faces the provider will simultaneously track.

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

    requestedMaximumFaceCount

    Get or set the maximum number of faces to track simultaneously.

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

    Thrown if the requested maximum face count is less than one. To stop face tracking, call Stop().

    NotSupportedException

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

    supportedFaceCount

    Get the number of faces the subsystem is able to track simultaneously in its current configuration.

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

    Methods

    GetChanges(Allocator)

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

    Declaration
    public override TrackableChanges<XRFace> GetChanges(Allocator allocator)
    Parameters
    Type Name Description
    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(Allocator). The caller owns the memory allocated with Allocator.

    Overrides
    TrackingSubsystem<XRFace, XRFaceSubsystem, XRFaceSubsystemDescriptor, XRFaceSubsystem.Provider>.GetChanges(Allocator)

    GetFaceMesh(TrackableId, Allocator, ref XRFaceMesh)

    Get the mesh data associated with the face with faceId. The faceMesh is reused if it is the correct size; otherwise, it is disposed and reallocated using allocator.

    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. Must be Allocator.TempJob or Allocator.Persistent.

    XRFaceMesh faceMesh

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

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if allocator is Allocator.Temp

    InvalidOperationException

    Thrown if allocator is Allocator.None

    Implements

    ISubsystem
    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)