OSVR-Core  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Eye tracker interface (base C API)

Sending eye tracker reports from a device in your plugin. More...

Typedefs

typedef struct
OSVR_EyeTrackerDeviceInterfaceObject * 
OSVR_EyeTrackerDeviceInterface
 Opaque type used to send data on eye tracker interface (which internally is carried over several interfaces).
 

Functions

OSVR_ReturnCode osvrDeviceEyeTrackerConfigure (OSVR_DeviceInitOptions opts, OSVR_EyeTrackerDeviceInterface *iface, OSVR_ChannelCount numSensors)
 Specify that your device will implement the Eye Tracker interface. More...
 
OSVR_ReturnCode osvrDeviceEyeTrackerReport2DGaze (OSVR_EyeTrackerDeviceInterface iface, OSVR_EyeGazePosition2DState gazePosition, OSVR_ChannelCount sensor, OSVR_TimeValue const *timestamp)
 Report gaze position 2D for a sensor (eye) - each component normalized from 0 to 1, lower-left corner of the screen is (0, 0) with the screen extending along the positive axes. More...
 
OSVR_ReturnCode osvrDeviceEyeTrackerReport3DGaze (OSVR_EyeTrackerDeviceInterface iface, OSVR_EyeGazeDirectionState gazeDirection, OSVR_EyeGazeBasePoint3DState gazeBasePoint, OSVR_ChannelCount sensor, OSVR_TimeValue const *timestamp)
 Report 3D gaze ray for an eye. More...
 
OSVR_ReturnCode osvrDeviceEyeTrackerReport3DGazeDirection (OSVR_EyeTrackerDeviceInterface iface, OSVR_EyeGazeDirectionState gazeDirection, OSVR_ChannelCount sensor, OSVR_TimeValue const *timestamp)
 3D gaze direction for an eye More...
 
OSVR_ReturnCode osvrDeviceEyeTrackerReportGaze (OSVR_EyeTrackerDeviceInterface iface, OSVR_EyeGazePosition2DState gazePosition, OSVR_EyeGazeDirectionState gazeDirection, OSVR_EyeGazeBasePoint3DState gazeBasePoint, OSVR_ChannelCount sensor, OSVR_TimeValue const *timestamp)
 Report both 2D and 3D gaze for an eye. More...
 
OSVR_ReturnCode osvrDeviceEyeTrackerReportBlink (OSVR_EyeTrackerDeviceInterface iface, OSVR_EyeTrackerBlinkState blink, OSVR_ChannelCount sensor, OSVR_TimeValue const *timestamp)
 Report the blink state. More...
 

Detailed Description

Sending eye tracker reports from a device in your plugin.

Note: At this time, a single device exposing an eye tracker interface cannot also separately expose a tracker, direction, button, or 2D location interface, due to use of those interfaces internally to carry eye tracker data. This is an implementation limitation, not an inherent design limitation, but it has not yet been necessary to resolve it.

Function Documentation

OSVR_ReturnCode osvrDeviceEyeTrackerConfigure ( OSVR_DeviceInitOptions  opts,
OSVR_EyeTrackerDeviceInterface iface,
OSVR_ChannelCount  numSensors 
)

#include <osvr/PluginKit/EyeTrackerInterfaceC.h>

Specify that your device will implement the Eye Tracker interface.

Parameters
optsThe device init options object.
[out]ifaceAn interface object you should retain with the same lifetime as the device token in order to send messages conforming to an imaging interface.
numSensorsThe number of eye tracker sensors you will be reporting: You can report 1 - 3 sensors.
OSVR_ReturnCode osvrDeviceEyeTrackerReport2DGaze ( OSVR_EyeTrackerDeviceInterface  iface,
OSVR_EyeGazePosition2DState  gazePosition,
OSVR_ChannelCount  sensor,
OSVR_TimeValue const *  timestamp 
)

#include <osvr/PluginKit/EyeTrackerInterfaceC.h>

Report gaze position 2D for a sensor (eye) - each component normalized from 0 to 1, lower-left corner of the screen is (0, 0) with the screen extending along the positive axes.

Parameters
ifaceEye Tracker interface
gazePositionThe 2D eye gaze position
sensorSensor number
timestampTimestamp correlating to eye data.
OSVR_ReturnCode osvrDeviceEyeTrackerReport3DGaze ( OSVR_EyeTrackerDeviceInterface  iface,
OSVR_EyeGazeDirectionState  gazeDirection,
OSVR_EyeGazeBasePoint3DState  gazeBasePoint,
OSVR_ChannelCount  sensor,
OSVR_TimeValue const *  timestamp 
)

#include <osvr/PluginKit/EyeTrackerInterfaceC.h>

Report 3D gaze ray for an eye.

Parameters
ifaceEye Tracker interface
gazeDirectionThe 3D eye gaze direction - unit vector
gazeBasePointThe 3D eye gaze base - origin of the gaze ray
sensorSensor number
timestampTimestamp correlating to eye data.
OSVR_ReturnCode osvrDeviceEyeTrackerReport3DGazeDirection ( OSVR_EyeTrackerDeviceInterface  iface,
OSVR_EyeGazeDirectionState  gazeDirection,
OSVR_ChannelCount  sensor,
OSVR_TimeValue const *  timestamp 
)

#include <osvr/PluginKit/EyeTrackerInterfaceC.h>

3D gaze direction for an eye

Parameters
ifaceEye Tracker interface
gazeDirectionThe 3D eye gaze direction - unit vector
sensorSensor number
timestampTimestamp correlating to eye data.
OSVR_ReturnCode osvrDeviceEyeTrackerReportGaze ( OSVR_EyeTrackerDeviceInterface  iface,
OSVR_EyeGazePosition2DState  gazePosition,
OSVR_EyeGazeDirectionState  gazeDirection,
OSVR_EyeGazeBasePoint3DState  gazeBasePoint,
OSVR_ChannelCount  sensor,
OSVR_TimeValue const *  timestamp 
)

#include <osvr/PluginKit/EyeTrackerInterfaceC.h>

Report both 2D and 3D gaze for an eye.

Parameters
ifaceEye Tracker interface
gazePositionThe 2D eye gaze position
gazeDirectionThe 3D eye gaze direction - unit vector
gazeBasePointThe 3D eye gaze base - origin of the gaze ray
sensorSensor number
timestampTimestamp correlating to eye data.
OSVR_ReturnCode osvrDeviceEyeTrackerReportBlink ( OSVR_EyeTrackerDeviceInterface  iface,
OSVR_EyeTrackerBlinkState  blink,
OSVR_ChannelCount  sensor,
OSVR_TimeValue const *  timestamp 
)

#include <osvr/PluginKit/EyeTrackerInterfaceC.h>

Report the blink state.

Parameters
ifaceEye Tracker interface
blinkWhether the eye is blinking ("pressed") or not.
sensorSensor number
timestampTimestamp correlating to eye data.