70 ifaceObj->location = location.get();
71 opts->addComponent(location);
74 ifaceObj->direction = direction.get();
75 opts->addComponent(direction);
78 ifaceObj->eyetracker = eyetracker.get();
79 opts->addComponent(eyetracker);
81 opts->setButtons(numChan, ifaceObj->button);
82 opts->setTracker(ifaceObj->tracker);
93 auto guard = iface->getSendGuard();
95 iface->location->sendLocationData(gazePosition, sensor, *timestamp);
96 iface->eyetracker->sendNotification(sensor, *timestamp);
109 auto guard = iface->getSendGuard();
111 iface->direction->sendDirectionData(gazeDirection, sensor, *timestamp);
112 iface->tracker->sendReport(gazeBasePoint, sensor, *timestamp);
113 iface->eyetracker->sendNotification(sensor, *timestamp);
126 auto guard = iface->getSendGuard();
128 iface->direction->sendDirectionData(gazeDirection, sensor, *timestamp);
129 iface->eyetracker->sendNotification(sensor, *timestamp);
145 auto guard = iface->getSendGuard();
147 iface->location->sendLocationData(gazePosition, sensor, *timestamp);
148 iface->tracker->sendReport(gazeBasePoint, sensor, *timestamp);
149 iface->direction->sendDirectionData(gazeDirection, sensor, *timestamp);
150 iface->eyetracker->sendNotification(sensor, *timestamp);
162 auto guard = iface->getSendGuard();
164 iface->button->setValue(blink, sensor, *timestamp);
165 iface->eyetracker->sendNotification(sensor, *timestamp);
uint32_t OSVR_ChannelCount
The integer type specifying a number of channels/sensors or a channel/sensor index.
A structure defining a 3D vector, often a position/translation.
OSVR_ReturnCode osvrDeviceEyeTrackerReportBlink(OSVR_EyeTrackerDeviceInterface iface, OSVR_EyeTrackerBlinkState blink, OSVR_ChannelCount sensor, OSVR_TimeValue const *timestamp)
Report the blink state.
static shared_ptr< DirectionComponent > create(OSVR_ChannelCount numSensor=1)
Factory method.
OSVR_ReturnCode osvrDeviceEyeTrackerReport3DGazeDirection(OSVR_EyeTrackerDeviceInterface iface, OSVR_EyeGazeDirectionState gazeDirection, OSVR_ChannelCount sensor, OSVR_TimeValue const *timestamp)
3D gaze direction for an eye
Structure used internally to construct the desired type of device.
#define OSVR_PLUGIN_HANDLE_NULL_CONTEXT(FUNC, CONTEXT_NAME)
Internal macro for use in C API function implementations to check the validity of a context parameter...
static shared_ptr< EyeTrackerComponent > create(OSVR_ChannelCount numSensor=2)
Factory method.
#define OSVR_RETURN_FAILURE
The "failure" value for an OSVR_ReturnCode.
A structure defining a 2D vector, which represents position.
OSVR_ReturnCode osvrDeviceEyeTrackerConfigure(OSVR_DeviceInitOptions opts, OSVR_EyeTrackerDeviceInterface *iface, OSVR_ChannelCount numChan)
Specify that your device will implement the Eye Tracker interface.
#define OSVR_RETURN_SUCCESS
The "success" value for an OSVR_ReturnCode.
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.
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.
static shared_ptr< Location2DComponent > create(OSVR_ChannelCount numSensor=1)
Factory method.
Internal, configured header file for verbosity macros.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
OSVR_ButtonState OSVR_EyeTrackerBlinkState
State for a blink event.
Base class for the DeviceInterfaceObjects retrieved by plugins to let them send data on an interface...
A wrapper to easily define structures that exist just to hold a pointer.
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.