Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SbTrackerInfo Class Reference

VSG extension Class for representing 3D tracker information. More...

#include <Inventor/events/SbTrackerInfo.h>

Public Member Functions

 SbTrackerInfo ()
 Constructor.
 
 ~SbTrackerInfo ()
 Destructor.
 
void setPosition3 (const SbVec3f &p)
 Set position of tracker in world coordinates.
 
const SbVec3fgetPosition3 () const
 Get position of tracker in world coordinates.
 
const SbRotationgetOrientation () const
 Get orientation of tracker as a standard Open Inventor rotation (quaternion).
 
void getOrientation (SbVec3f &axis, float &angle) const
 Get orientation of tracker.
 
void setOrientation (float q0, float q1, float q2, float q3)
 Set orientation value from 4 floats defining the rotation quaternion.
 
void setOrientation (const float q[4])
 Set orientation value from array of 4 floats defining the rotation quaternion.
 
void setOrientation (const SbVec3f &axis, float angle)
 Set orientation value from axis and angle in radians.
 
void setOrientation (SbRotation orientation)
 Set orientation value from an SbRotation.
 
void setOrientation (float xangle, float yangle, float zangle)
 Set orientation value from Euler angles in radians (using the trackd convention Z*X*Y).
 
const SbLine getRay () const
 Convenience function to get ray for picking/intersecting.
 
void setData (void *appData)
 Set application data.
 
const void * getData () const
 Get application data.
 

Detailed Description

VSG extension Class for representing 3D tracker information.

An object that stores information about the state of a 3D tracker device, specifically position and orientation.

A "tracker" is any device whose position and orientation are dynamically tracked in 3D, typically for immersive VR applications. For example: a head tracker. A "controller" is an input device which typically has buttons and/or valuators (e.g. a joystick). Many controllers have an associated tracker. For example, the commonly used "wand" input device has three buttons, a two-axis joystick (two valuators), and an associated tracker.

The virtual method SoEvent::getTrackerInfo() can be used to determine if an event object has associated tracker information. Traditional 2D events like SoMouseButtonEvent and SoLocation2Event return NULL. 3D events like SoTrackerEvent and SoControllerButtonEvent return a pointer to their associated tracker information (SbTrackerInfo).

In addition to the usual methods for setting an orientation, this class provides a method that takes three Euler angles specified in radians. This allows orientation information returned by the widely used trackd API to be stored directly into an Open Inventor event object.

Tracker info is most often used by Open Inventor classes to specify a direction for picking or intersection with a dragger. This class provides the getRay() method to conveniently get an SbLine defining the direction the tracker is pointing.

This class also provides a void * data member that could be used, for example, to distinguish different tracker devices or communicate any other information between an application and custom nodes in the scene graph. Open Inventor does not set or use this variable.

SEE ALSO

SoControllerButtonEvent, SoEvent, SoTrackerEvent

Definition at line 73 of file SbTrackerInfo.h.

Constructor & Destructor Documentation

◆ SbTrackerInfo()

SbTrackerInfo::SbTrackerInfo ( )

Constructor.

◆ ~SbTrackerInfo()

SbTrackerInfo::~SbTrackerInfo ( )

Destructor.

Member Function Documentation

◆ getData()

const void * SbTrackerInfo::getData ( ) const
inline

Get application data.

Definition at line 152 of file SbTrackerInfo.h.

◆ getOrientation() [1/2]

const SbRotation & SbTrackerInfo::getOrientation ( ) const
inline

Get orientation of tracker as a standard Open Inventor rotation (quaternion).

Definition at line 100 of file SbTrackerInfo.h.

◆ getOrientation() [2/2]

void SbTrackerInfo::getOrientation ( SbVec3f axis,
float &  angle 
) const
inline

Get orientation of tracker.

Return value as axis and angle.

Definition at line 106 of file SbTrackerInfo.h.

◆ getPosition3()

const SbVec3f & SbTrackerInfo::getPosition3 ( ) const
inline

Get position of tracker in world coordinates.

Definition at line 94 of file SbTrackerInfo.h.

◆ getRay()

const SbLine SbTrackerInfo::getRay ( ) const

Convenience function to get ray for picking/intersecting.

◆ setData()

void SbTrackerInfo::setData ( void *  appData)
inline

Set application data.

Definition at line 147 of file SbTrackerInfo.h.

◆ setOrientation() [1/5]

void SbTrackerInfo::setOrientation ( const float  q[4])
inline

Set orientation value from array of 4 floats defining the rotation quaternion.

Definition at line 118 of file SbTrackerInfo.h.

◆ setOrientation() [2/5]

void SbTrackerInfo::setOrientation ( const SbVec3f axis,
float  angle 
)
inline

Set orientation value from axis and angle in radians.

Definition at line 124 of file SbTrackerInfo.h.

◆ setOrientation() [3/5]

void SbTrackerInfo::setOrientation ( float  q0,
float  q1,
float  q2,
float  q3 
)
inline

Set orientation value from 4 floats defining the rotation quaternion.

Definition at line 112 of file SbTrackerInfo.h.

◆ setOrientation() [4/5]

void SbTrackerInfo::setOrientation ( float  xangle,
float  yangle,
float  zangle 
)

Set orientation value from Euler angles in radians (using the trackd convention Z*X*Y).

◆ setOrientation() [5/5]

void SbTrackerInfo::setOrientation ( SbRotation  orientation)
inline

Set orientation value from an SbRotation.

Definition at line 130 of file SbTrackerInfo.h.

◆ setPosition3()

void SbTrackerInfo::setPosition3 ( const SbVec3f p)
inline

Set position of tracker in world coordinates.

Definition at line 89 of file SbTrackerInfo.h.


The documentation for this class was generated from the following file: