Eye Tracking

VIVE Wave™ XR plugin provides the Eye Tracking feature in the Essence package (refer to Wave XR Plugin Packages).

By following this tutorial you can retrieve the tracking data of left, right and combined eyes through Eye Manager. The Eye Tracking data contains:

  • Gaze origin
  • Gaze direction
  • Eye openness
  • Pupil diameter
  • Pupil position

You can use the Eye Tracking data to implementing the Gaze feature. VIVE Wave™ XR plugin also provides two components of Eye Tracking Gaze.

After imported the Essence package you can use either of the two components.

Modify AndroidManifest.xml

To enable the Eye Tracking feature, you have to add below content to your AndroidManifest.xml.

<uses-feature android:name="wave.feature.eyetracking" android:required="true" />

Eye Manager

Before using the Eye Tracking API, you need to add the EyeManager to your scene from the menu item.

../_images/UnityXREyeTracking03.png ../_images/UnityXREyeTracking04.png

Note

Enabling the Eye Tracking feature will consume additional power.

You can refer to Packages > VIVE Wave XR Plugin - Essence > Runtime > Scripts > EyeTracking > EyeManager.cs about the Eye Tracking Public API.

Here listed the Eye Tracking APIs:

using Wave.Essence.Eye;

// Enable Eye Tracking:
if (EyeManager.Instance != null) { EyeManager.Instance.EnableEyeTracking = true; }

// Eye Tracking Status:
public EyeTrackingStatus GetEyeTrackingStatus()
public bool IsEyeTrackingAvailable()

// Eye Origin/Direction:
public enum EyeType {
        Combined = 0,
        Right,
        Left
}

public bool GetEyeOrigin(EyeType eye, out Vector3 origin)
public bool GetEyeDirectionNormalized(EyeType eye, out Vector3 direction)

// Combined Eye:
public bool GetCombinedEyeOrigin(out Vector3 origin)
public bool GetCombindedEyeDirectionNormalized(out Vector3 direction)

// Left Eye:
public bool GetLeftEyeOrigin(out Vector3 origin)
public bool GetLeftEyeDirectionNormalized(out Vector3 direction)
public bool GetLeftEyeOpenness(out float openness)
public bool GetLeftEyePupilDiameter(out float diameter)
public bool GetLeftEyePupilPositionInSensorArea(out Vector2 area)

// Right Eye:
public bool GetRightEyeOrigin(out Vector3 origin)
public bool GetRightEyeDirectionNormalized(out Vector3 direction)
public bool GetRightEyeOpenness(out float openness)
public bool GetRightEyePupilDiameter(out float diameter)
public bool GetRightEyePupilPositionInSensorArea(out Vector2 area)

Gaze Input Module

You can refer to Gaze Input about the usage of GazeInputModule.

For Eye Tracking, GazeInputModule provides additional options as below photo.

../_images/UnityXREyeTracking01.png

Eye Tracking: Selects to use Eye Tracking data in GazeInputModule.

Eye: Selects one of the Eye Tracking sources, Combined, Left or Right eye.

The GazeInputModule Eye Tracking depends on the EyeManager.

../_images/UnityXREyeTracking05.png

Gaze Raycast

Instead of using GazeInputModule, you can use GazeRaycastRing located at Packages > VIVE Wave XR Plugin - Essence > Runtime > Scripts > Raycast.

../_images/UnityXREyeTracking06.png

You can refer to Gaze Raycast Ring about the usage of GazeRaycastRing.

For Eye Tracking, GazeRaycastRing provides additional options as below photo.

../_images/UnityXREyeTracking02.png

Eye Tracking: Selects to use Eye Tracking data in GazeRaycastRing.

Eye: Selects one of the Eye Tracking sources, Combined, Left or Right eye.

Troubleshooting

  1. No Eye Tracking data

=> Ensure that you already Modify AndroidManifest.xml and put the Eye Manager in your scene.

  1. GazeRaycastRing does NOT show the ring.

=> Ensure that your scene had the RaycastSwitch and selected the Gaze Raycast > Enabled.

../_images/UnityXREyeTracking07.png