Support Forum       G3D Web Page     
Classes | Public Member Functions | Static Protected Member Functions | List of all members
G3D::GazeTracker Class Referenceabstract

API for low-level gaze tracking. More...

Inherits G3D::ReferenceCountedObject.

Inherited by G3D::EmulatedGazeTracker.

Classes

class  Gaze
 

Public Member Functions

virtual const StringclassName () const =0
 Which subclass of GazeTracker is this? More...
 
virtual void getInstantaneousGaze (Gaze &left, Gaze &right) const =0
 Raw data with minimal latency. More...
 
virtual void getTrackedGaze (Gaze &left, Gaze &right) const
 All values are in world space. More...
 
virtual Point3 headSpaceCalibrationPoint () const
 When in calibration mode, the application should draw the calibration target at this location in head space. More...
 
virtual void setCalibrationMode (bool c)
 The application should call with c = true to begin calibration, and then poll headSpaceCalibrationPoint() every frame to draw the target. More...
 

Static Protected Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Detailed Description

API for low-level gaze tracking.

See also
XRWidget, EmulatedGazeTracker, EmulatedXR, OpenVR, XRWidget::gazeRay, GApp::gazeTracker

Member Function Documentation

◆ className()

virtual const String& G3D::GazeTracker::className ( ) const
pure virtual

Which subclass of GazeTracker is this?

Implemented in G3D::EmulatedGazeTracker.

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

◆ getInstantaneousGaze()

virtual void G3D::GazeTracker::getInstantaneousGaze ( Gaze left,
Gaze right 
) const
pure virtual

Raw data with minimal latency.

Because this will likely be called at the frame rate of the display, we recommend that subclasses model the rate and phase of calls and only process gaze information on a separate thread right before the anticipated time of the next call. This avoids the typical behavior of gaze trackers, which is to run continuously at high rates and throw out most frames without spending resources processing them unless those intermediate frames are needed to reduce error.

See also
getTrackedGaze

Implemented in G3D::EmulatedGazeTracker.

Referenced by getTrackedGaze().

◆ getTrackedGaze()

virtual void G3D::GazeTracker::getTrackedGaze ( Gaze left,
Gaze right 
) const
inlinevirtual

All values are in world space.

You can convert them to screen space by the usual method: transform to the camera's reference frame and intersect these rays with the image plane.

This may be a filtered version of getInstantaneousGaze().

The default implementation directly returns getInstantaneousGaze(), but will likely contain automatic filtering in a future release.

◆ headSpaceCalibrationPoint()

virtual Point3 G3D::GazeTracker::headSpaceCalibrationPoint ( ) const
inlinevirtual

When in calibration mode, the application should draw the calibration target at this location in head space.

When this returns Point3::nan(), calibration has ended.

Reimplemented in G3D::EmulatedGazeTracker.

◆ setCalibrationMode()

virtual void G3D::GazeTracker::setCalibrationMode ( bool  c)
inlinevirtual

The application should call with c = true to begin calibration, and then poll headSpaceCalibrationPoint() every frame to draw the target.

Calibration will end on its own. To abort calibration early and return to the previous calibrated value, invoke setCalibrationMode(false).

Reimplemented in G3D::EmulatedGazeTracker.


documentation generated on Wed Nov 24 2021 08:01:56 using doxygen 1.8.15