Unity XR InputDevice - Eye Tracking

Refer to Wave XR Plugin Packages about VIVE Wave™ XR plugin packages.

Wave.OpenXR.InputDeviceEye: Provides an interface to access UnityEngine.XR.Eyes.

InputDeviceEye Eye Tracking API

To use the Wave.OpenXR.InputDeviceEye class, you have to import the XRSDK package (refer to Wave XR Plugin Packages).

The InputDeviceEye class provides APIs to retrieve the eye tracking data of UnityEngine.XR.Eyes easily.

Expressions

public enum Expressions : UInt32
{
    LEFT_BLINK = 0,
    LEFT_WIDE = 1,
    RIGHT_BLINK = 2,
    RIGHT_WIDE = 3,
    LEFT_SQUEEZE = 4,
    RIGHT_SQUEEZE = 5,
    LEFT_DOWN = 6,
    RIGHT_DOWN = 7,
    LEFT_OUT = 8,
    RIGHT_IN = 9,
    LEFT_IN = 10,
    RIGHT_OUT = 11,
    LEFT_UP = 12,
    RIGHT_UP = 13,
    MAX,
}

TrackingStatus

public enum TrackingStatus : UInt32
{
    NOT_START = 0,
    START_FAILURE = 1,
    STARTING = 2,
    STOPPING = 3,
    AVAILABLE = 4,
    UNSUPPORT = 5,
}

TrackingSpace

public enum TrackingSpace : UInt32
{
    Local = 0,
    World = 1,
}

ActivateEyeTracking

Enables or disables the Eye Tracking feature.

void ActivateEyeTracking(bool active)

GetEyeTrackingStatus

Retrieves current Eye Tracking status.

TrackingStatus GetEyeTrackingStatus()

IsEyeTrackingAvailable

Checks if the Eye Expression feature is available currently.

bool IsEyeTrackingAvailable()

SetEyeTrackingSpace

Sets up the eye tracking space.

When the eye space is Local, the tracking position is a fixed value which presents the offset from HMD to eye.

When the eye space is World, the tracking position is a value which presents (the offset from HMD to eye) + (the HMD position).

void SetEyeTrackingSpace(TrackingSpace space)

IsEyeTrackingDevice

Checks if an InputDevice is Wave Eye Tracking device.

bool IsEyeTrackingDevice(InputDevice input)

IsEyeTrackingDeviceConnected

Checks if a Wave Eye Tracking device is connected.

bool IsEyeTrackingDeviceConnected()

IsEyeTrackingTracked

Checks if a Wave Eye Tracking device is tracked.

bool IsEyeTrackingTracked()

GetEyeTrackingData

Retrieves the Unity XR Eyes data.

bool GetEyeTrackingData(out Eyes eyeData)

GetCombinedEyeOrigin

Retrieves the combined eye origin in Vector3.

bool GetCombinedEyeOrigin(out Vector3 origin)

GetCombinedEyeDirection

Retrieves the combined eye direction in Vector3. See Fixation Point.

bool GetCombinedEyeDirection(out Vector3 direction)

GetLeftEyeOrigin

Retrieves the left eye origin in Vecotr3. See Left Eye Position.

bool GetLeftEyeOrigin(out Vector3 origin)

GetLeftEyeDirection

Retrieves the left eye direction in Vector3. See Left Eye Rotation.

bool GetLeftEyeDirection(out Vector3 direction)

GetLeftEyeOpenness

Retrieves the left eye openness in float. See Left Eye Open Amount.

bool GetLeftEyeOpenness(out float openness)

GetLeftEyePupilDiameter

Retrieves the left eye pupil diameter.

bool GetLeftEyePupilDiameter(out float pupilDiameter)

GetLeftEyePupilPositionInSensorArea

Retrieves the left eye pupil position (Vector2) in sensor area.

bool GetLeftEyePupilPositionInSensorArea(out Vector2 pupilPosition)

GetRightEyeOrigin

Retrieves the right eye origin in Vector3.

bool GetRightEyeOrigin(out Vector3 origin)

GetRightEyeDirection

Retrieves the right eye direction in Vector3. See Right Eye Rotation.

bool GetRightEyeDirection(out Vector3 direction)

GetRightEyeOpenness

Retrieves the right eye openness in float. See Right Eye Open Amount.

bool GetRightEyeOpenness(out float openness)

GetRightEyePupilDiameter

Retrieves the right eye pupil diameter.

bool GetRightEyePupilDiameter(out float pupilDiameter)

GetRightEyePupilPositionInSensorArea

Retrieves the right eye pupil position (Vector2) in sensor area.

bool GetRightEyePupilPositionInSensorArea(out Vector2 pupilPosition)

InputDeviceEye Eye Expression API

To use the Wave.OpenXR.InputDeviceEye class, you have to import the XRSDK package (refer to Wave XR Plugin Packages).

The InputDeviceEye class provides APIs to retrieve the eye expression data.

ActivateEyeExpression

Enables or disables the Eye Expression feature.

void ActivateEyeExpression(bool active)

IsEyeExpressionAvailable

Checks if the Eye Expression feature is available currently.

bool IsEyeExpressionAvailable()

HasEyeExpressionValue

Checks if the Eye Expression value is provided in runtime.

bool HasEyeExpressionValue()

GetEyeExpressionValue

Retrieves the value of an eye expression.

float GetEyeExpressionValue(Expressions exp)

GetEyeExpressionValues

Retrieves all Eye Expression values in a float array. The values are sorted in the order of Expressions enumeration. See Expressions.

bool GetEyeExpressionValues(out float[] values)