Eye Tracking Handler
The Eye Tracking Handler registers entities and exposes gaze, blink and extended-view data. IsAvailable checks whether the eye-tracking engine is installed; IsActive checks whether eye tracking is active. Entity registration makes an entity available for gaze queries.
Contents
Before you start
- Open the map script inside your own mod. Keep its generated includes,
cScrMap : iScrMapclass and callback structure. See Add your first script if you have not edited a map script yet. - Add the helper include shown below alongside the script’s other includes.
- Read the stock example before copying its calls: named entities, voice subjects, materials and callbacks must belong to the map or resources you are using.
Follow the stock example
#include "helpers/helper_modules.hps"
EyeTracking_IsAvailable
If the eye tracking engine is installed
In script/modules/MenuHandler.hps, SOMA calls EyeTracking_IsAvailable as follows.
EyeTracking_IsAvailable();
This is an excerpt from that stock script; its referenced names and variables belong to that script.
EyeTracking_RegisterEntity
Registers an entity for eye tracking
EyeTracking_RegisterEntity
Registers an entity for eye tracking
EyeTracking_IsEntityBeingLookedAt
If the specified entity is being looked at
EyeTracking_IsEntityBeingLookedAt
If the specified entity is being looked at
Check your change
Save the script and restart the map in development mode with F5. If the script fails, open F1 and use Show Error List or Show HPL Log. See the development loop for the launch and debugging steps.