Class XRFaceSubsystem.IProvider
Class to be implemented by an implementor of the XRFaceSubsystem.
Namespace: UnityEngine.XR.ARSubsystems
Syntax
protected class IProvider : object
Properties
supported
Called by supported.
Return true
if face tracking is supported on the current device.
Declaration
public virtual bool supported { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Destroy()
Called by Destroy() 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 virtual TrackableChanges<XRFace> GetChanges(XRFace defaultFace, Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
XRFace | defaultFace | The default face. This should be used to initialize the returned |
Allocator | allocator | An |
Returns
Type | Description |
---|---|
TrackableChanges<XRFace> | TrackableChanges<T> describing the faces that have been added, updated, and removed
since the last call to |
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 NativeArray
s are disposed properly and
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 Start(). Only invoked if not already running.
Declaration
public virtual void Start()
Stop()
Called by Stop(). Only invoked if current running.
Declaration
public virtual void Stop()