Class ARFace | AR Foundation | 2.2.0-preview.6
docs.unity3d.com
    Show / Hide Table of Contents

    Class ARFace

    Represents a face detected by an AR device.

    Inheritance
    Object
    ARTrackable<XRFace, ARFace>
    ARFace
    Inherited Members
    ARTrackable<XRFace, ARFace>.destroyOnRemoval
    ARTrackable<XRFace, ARFace>.trackableId
    ARTrackable<XRFace, ARFace>.trackingState
    ARTrackable<XRFace, ARFace>.pending
    ARTrackable<XRFace, ARFace>.sessionRelativeData
    ARTrackable<XRFace, ARFace>.OnAfterSetSessionRelativeData()
    Namespace: UnityEngine.XR.ARFoundation
    Syntax
    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 position of which the eyes are fixated in relation to the face. Use fixationPoint.HasValue to determine if this data is available.

    Declaration
    public Transform fixationPoint { get; }
    Property Value
    Type Description
    Transform
    Remarks

    The data is returned in relation to the face pose itself and not session space.

    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 pose of the left eye in relation to the face. Use leftEyePose.HasValue to determine if this data is available.

    Declaration
    public Transform leftEye { get; }
    Property Value
    Type Description
    Transform
    Remarks

    The data is returned in relation to the face pose itself and not session space.

    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 pose of the right eye in relation to the face. Use rightEyePose.HasValue to determine if this data is available.

    Declaration
    public Transform rightEye { get; }
    Property Value
    Type Description
    Transform
    Remarks

    The data is returned in relation to the face pose itself and not session space.

    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>
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023