Eye Tracking API Reference¶
Here listed the Eye Tracking APIs.
- Wave.OpenXR.InputDeviceEye: Provides an interface to access UnityEngine.XR.Eyes.
- Wave.Essence.Eye.EyeManager: Provides VIVE Wave™ XR Plugin Eye Tracking interface.
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)
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()
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)
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)
EyeManager Interface¶
To use the Wave.Essence.Eye.EyeManager class, you have to import the Essence package (refer to Wave XR Plugin Packages).
EyeType¶
public enum EyeType
{
Combined = 0,
Right,
Left
}
EyeTrackingStatus¶
public enum EyeTrackingStatus
{
// Initial, can call Start API in this state.
NOT_START,
START_FAILURE,
// Processing, should NOT call API in this state.
STARTING,
STOPING,
// Running, can call Stop API in this state.
AVAILABLE,
// Do nothing.
UNSUPPORT
}
EyeSpace¶
public enum EyeSpace : UInt32
{
Local = WVR_CoordinateSystem.WVR_CoordinateSystem_Local,
World = WVR_CoordinateSystem.WVR_CoordinateSystem_Global
}
GetEyeTrackingStatus¶
Retrieves current eye tracking service status.
EyeTrackingStatus GetEyeTrackingStatus()
IsEyeTrackingAvailable¶
Checks whether the eye tracking service is available.
bool IsEyeTrackingAvailable()
GetEyeOrigin¶
Retrieves the origin location of specified eye.
bool GetEyeOrigin(EyeType eye, out Vector3 origin)
GetEyeDirectionNormalized¶
Retrieves the normalized direction of specified eye.
bool GetEyeDirectionNormalized(EyeType eye, out Vector3 direction)
GetCombinedEyeOrigin¶
Retrieves the origin location of combined eye.
bool GetCombinedEyeOrigin(out Vector3 origin)
GetCombindedEyeDirectionNormalized¶
Retrieves the looking direction of combined eye.
bool GetCombindedEyeDirectionNormalized(out Vector3 direction)
GetLeftEyeOrigin¶
Retrieves the origin location of left eye.
bool GetLeftEyeOrigin(out Vector3 origin)
GetLeftEyeDirectionNormalized¶
Retrieves the looking direction of left eye.
bool GetLeftEyeDirectionNormalized(out Vector3 direction)
GetLeftEyeOpenness¶
Retrieves the value representing how open the left eye is.
bool GetLeftEyeOpenness(out float openness)
GetLeftEyePupilDiameter¶
Retrieves the diameter of left eye pupil in millimeters.
bool GetLeftEyePupilDiameter(out float diameter)
GetLeftEyePupilPositionInSensorArea¶
Retrieves the normalized position of left eye pupil in Vector2.
bool GetLeftEyePupilPositionInSensorArea(out Vector2 area)
GetRightEyeOrigin¶
Retrieves the origin location of right eye.
bool GetRightEyeOrigin(out Vector3 origin)
GetRightEyeDirectionNormalized¶
Retrieves the looking direction of right eye.
bool GetRightEyeDirectionNormalized(out Vector3 direction)
GetRightEyeOpenness¶
Retrieves the value representing how open the right eye is.
bool GetRightEyeOpenness(out float openness)
GetRightEyePupilDiameter¶
Retrieves the diameter of right eye pupil in millimeters.
bool GetRightEyePupilDiameter(out float diameter)
GetRightEyePupilPositionInSensorArea¶
Retrieves the normalized position of right eye pupil in Vector2.
bool GetRightEyePupilPositionInSensorArea(out Vector2 area)