Class ARFace
Represents a face detected by an AR device.
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Syntax
[DisallowMultipleComponent]
[DefaultExecutionOrder(-2147483646)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.0/api/UnityEngine.XR.ARFoundation.ARFace.html")]
public sealed class ARFace : ARTrackable<XRFace, ARFace>
Remarks
Generated by the ARFaceManager when an AR device detects a face in the environment.
Properties
fixationPoint
The transform representing the point at which the eyes are fixated upon or null
if there is no fixation data.
Declaration
public Transform fixationPoint { get; }
Property Value
Type | Description |
---|---|
Transform |
indices
The indices defining the triangles of the face mesh. Check for existence with indices.IsCreated
.
The are three times as many indices as triangles, so this will always be a multiple of 3.
Declaration
public NativeArray<int> indices { get; }
Property Value
Type | Description |
---|---|
NativeArray<Int32> |
leftEye
The transform of the left eye of the face, or null
if there is no data for the left eye.
Declaration
public Transform leftEye { get; }
Property Value
Type | Description |
---|---|
Transform |
nativePtr
Get a native pointer associated with this face.
Declaration
public IntPtr nativePtr { get; }
Property Value
Type | Description |
---|---|
IntPtr |
Remarks
The data pointed to by this member is implementation defined. The lifetime of the pointed to object is also implementation defined, but should be valid at least until the next ARSession update.
normals
The normals representing the face mesh. Check for existence with normals.IsCreated
.
This array is parallel to vertices and uvs.
Declaration
public NativeArray<Vector3> normals { get; }
Property Value
Type | Description |
---|---|
NativeArray<Vector3> |
rightEye
The transform of the right eye of the face, or null
if there is no data for the right eye.
Declaration
public Transform rightEye { get; }
Property Value
Type | Description |
---|---|
Transform |
uvs
The texture coordinates representing the face mesh. Check for existence with uvs.IsCreated
.
This array is parallel to vertices and normals.
Declaration
public NativeArray<Vector2> uvs { get; }
Property Value
Type | Description |
---|---|
NativeArray<Vector2> |
vertices
The vertices representing the face mesh. Check for existence with vertices.IsCreated
.
This array is parallel to normals and uvs. Vertices are
provided in face space, that is, relative to this ARFace's local
position and rotation.
Declaration
public NativeArray<Vector3> vertices { get; }
Property Value
Type | Description |
---|---|
NativeArray<Vector3> |
Events
updated
Invoked when the face is updated. If face meshes are supported, there will be updated vertices, normals, indices, and uvs.
Declaration
public event Action<ARFaceUpdatedEventArgs> updated
Event Type
Type | Description |
---|---|
Action<ARFaceUpdatedEventArgs> |