Interface to trackdAPI (position, matrix, Euler angles). More...
#include <ScaleViz/interaction/SoTrackerReader.h>
Public Member Functions | |
SoTrackerReader (int) | |
virtual | ~SoTrackerReader () |
int | getNumberOfSensors () |
void | getPosition (int id, float *pos) |
SbVec3f | getPosition (int id) |
void | getEulerAngles (int id, float *orn) |
SbVec3f | getEulerAngles (int id) |
void | getMatrix (int id, float mat[4][4]) |
SbMatrix | getMatrix (int id) |
SbBool | isLoadSuccess () |
SbBool | isInitSuccess () |
void | setTransformMatrix (int id, SbMatrix RealToWorld) |
SbMatrix | getTransformMatrix (int id) |
void | setUnitScaleFactor (float) |
float | getUnitScaleFactor () |
SoTrackerReader is a class that interfaces to trackdAPI from VRCO. It provides access functions to the coordinate data from the tracking system (position, matrix, and Euler angles). SoTrackerReader can convert the raw data from trackd with a transformation matrix (provided by the user in the application or provided during calibration). SoTrackerReader is instantiated by the SbConfig class, if the configuration file specifies the use of a tracking system (by providing shared memory keys). See SbConfig::getTrackerReader.
NOTE: trackd from VRCO (www.vrco.com) is not included with Open Inventor. If trackd exists on the system, Open Inventor will dynamically load it at run time. See trackd documentation for information about the values returned.
SoTrackerReader::SoTrackerReader | ( | int | ) |
Constructor.
The argument passed to the constructor is the shared memory key used by trackd. The constructor dynamically loads trackdAPI into memory, and gets the necessary function addresses.
virtual SoTrackerReader::~SoTrackerReader | ( | ) | [virtual] |
Destructor.
SbVec3f SoTrackerReader::getEulerAngles | ( | int | id | ) |
Gets the Euler angle values for sensor identified by id.
void SoTrackerReader::getEulerAngles | ( | int | id, | |
float * | orn | |||
) |
Gets the Euler angle values for sensor identified by id.
SbMatrix SoTrackerReader::getMatrix | ( | int | id | ) |
Gets the transformation matrix for sensor identified by id.
void SoTrackerReader::getMatrix | ( | int | id, | |
float | mat[4][4] | |||
) |
Gets the transformation matrix for sensor identified by id.
int SoTrackerReader::getNumberOfSensors | ( | ) |
Returns the number of sensors the tracker daemon is storing.
SbVec3f SoTrackerReader::getPosition | ( | int | id | ) |
Gets the position values for the sensor identified by id.
void SoTrackerReader::getPosition | ( | int | id, | |
float * | pos | |||
) |
Gets the position values for the sensor identified by id.
SbMatrix SoTrackerReader::getTransformMatrix | ( | int | id | ) |
Returns the transformation matrix applied to the coordinates from the tracking system.
float SoTrackerReader::getUnitScaleFactor | ( | ) |
Returns the unit scale factor.
SbBool SoTrackerReader::isInitSuccess | ( | ) | [inline] |
Returns TRUE if Inventor was able to retrieve all the trackdAPI functions.
SbBool SoTrackerReader::isLoadSuccess | ( | ) | [inline] |
Returns TRUE if libtrackd.so was loaded successfully.
void SoTrackerReader::setTransformMatrix | ( | int | id, | |
SbMatrix | RealToWorld | |||
) |
Sets the transformation matrix applied to the coordinates from the tracking system.
The transformation matrix is from raw (real world) coordinates to Inventor (3D world) coordinates.
void SoTrackerReader::setUnitScaleFactor | ( | float | ) |
Sets the unit scale factor.
The positions from the tracker are multiplied by the unit scale factor. The initial unit is provided by the tracking system. For example, the tracking system gives coordinates in feet. For coordinates in inches, the unit scale factor should be set to 12.0.