Class XRFaceSubsystem.Provider
Class to be implemented by an implementor of the XRFaceSubsystem.
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
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 |
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
Declaration
public virtual void Start()
Stop()
Called by
Declaration
public virtual void Stop()