Class ARFace
Represents a face detected by an AR device.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Assembly: Unity.XR.ARFoundation.dll
Syntax
[DisallowMultipleComponent]
[DefaultExecutionOrder(-2147483646)]
public sealed class ARFace : ARTrackable<XRFace, ARFace>, ITrackable
Remarks
Generated by the ARFaceManager when an AR device detects a face in the environment.
Properties
fixationPoint
The transform representing the point where the eyes are fixated 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<int> |
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 |
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> |