Class ARKitFaceSubsystem
Inheritance
Namespace: UnityEngine.XR.ARKit
Syntax
public class ARKitFaceSubsystem : XRFaceSubsystem
Constructors
ARKitFaceSubsystem()
Constructs the XRFaceSubsystem implementation and static native arrays and initializes the provider.
Declaration
public ARKitFaceSubsystem()
Methods
Destroy()
Shutsdown the provider, removes the XRFaceSubsystem implementation and disposes of the memory used by static arrays.
Declaration
public override void Destroy()
Start()
Starts the XRFaceSubsystem provider to begin providing face data via the callback delegates
Declaration
public override void Start()
Stop()
Stops the XRFaceSubsystem provider from providing face data
Declaration
public override void Stop()
TryGetAllFaces(List<XRFace>)
XRFaceSubsystem API method that this provider overrides to provide a list of faces it keeps track of.
Declaration
public override bool TryGetAllFaces(List<XRFace> facesOut)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.List<XRFace> | facesOut | A list that will contain all the faces that the provider is tracking currently |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Throws an exception if the facesOut parameter is not a valid list. |
TryGetFaceARKitBlendShapeCoefficients(TrackableId, List<XRFaceArkitBlendShapeCoefficient>)
Platform specific API method that this provider uses to provide a list of XRFaceArkitBlendShapeCoefficient that can be used to render facial expressions using blend shapes.
Declaration
public bool TryGetFaceARKitBlendShapeCoefficients(TrackableId faceId, List<XRFaceArkitBlendShapeCoefficient> coefficientsOut)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | faceId | The |
| System.Collections.Generic.List<XRFaceArkitBlendShapeCoefficient> | coefficientsOut | Replaces the content with the list of XRFaceArkitBlendShapeCoefficient that will contain pairs of XRArkitBlendShapeLocation and floats that describe the current facial expression on the face. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if face blend shape coefficients were successfully populated. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Throws an exception if the coefficientsOut parameter is not a valid list. |
TryGetFaceMeshIndices(TrackableId, List<Int32>)
XRFaceSubsystem API method that this provider overrides to provide a list of triangle indices for a face mesh
Declaration
public override bool TryGetFaceMeshIndices(TrackableId faceId, List<int> indicesOut)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | faceId | The |
| System.Collections.Generic.List<System.Int32> | indicesOut | Replaces the content with the list of System.Int32 that will contain all the triangle indices of the face mesh. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if face mesh triangle indices were successfully populated. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Throws an exception if the indicesOut parameter is not a valid list. |
TryGetFaceMeshUVs(TrackableId, List<Vector2>)
XRFaceSubsystem API method that this provider overrides to provide a list of texture coordinates for a face mesh
Declaration
public override bool TryGetFaceMeshUVs(TrackableId faceId, List<Vector2> uvsOut)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | faceId | The |
| System.Collections.Generic.List<Vector2> | uvsOut | Replaces the content with the list of |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if face mesh UVs were successfully populated. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Throws an exception if the uvsOut parameter is not a valid list. |
TryGetFaceMeshVertices(TrackableId, List<Vector3>)
FaceSubsytem API method that this provider overrides to provide a list of vertex positions for a face mesh
Declaration
public override bool TryGetFaceMeshVertices(TrackableId faceId, List<Vector3> verticesOut)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | faceId | The |
| System.Collections.Generic.List<Vector3> | verticesOut | Replaces the content with the list of |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if face mesh vertices were successfully populated. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Throws an exception if the verticesOut parameter is a null reference. |
TryRemoveFace(TrackableId)
FaeSubsystem API method to remove a face from the session.
Declaration
public override bool TryRemoveFace(TrackableId faceId)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | faceId | The |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if face was removed |