Interface to trackdAPI (buttons, valuators). More...
#include <ScaleViz/interaction/SoControllerReader.h>
Public Member Functions | |
SoControllerReader (int) | |
virtual | ~SoControllerReader () |
int | getNumberOfValuators () |
int | getNumberOfButtons () |
float | getValuator (int id) |
int | getButton (int id) |
int | buttonChange (int id) |
SbBool | isLoadSuccess () |
SbBool | isInitSuccess () |
SoControllerReader is a class that interfaces to trackdAPI. It provides access functions to the states of buttons and valuators of VR input devices, e.g., the buttons and joystick of a wand. 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::getControllerReader.
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.
SoControllerReader::SoControllerReader | ( | 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 SoControllerReader::~SoControllerReader | ( | ) | [virtual] |
Destructor.
int SoControllerReader::buttonChange | ( | int | id | ) |
Returns information about changes of the state of the button identified by id.
The function returns 0 if the state of the button hasn't changed, returns -1, if the button was released, returns 1, if the button was pressed.
int SoControllerReader::getButton | ( | int | id | ) |
Returns the value of button identified by id from the tracker daemon.
int SoControllerReader::getNumberOfButtons | ( | ) |
Returns the number of buttons the tracker daemon is storing.
int SoControllerReader::getNumberOfValuators | ( | ) |
Returns the number of valuators the tracker daemon is storing.
float SoControllerReader::getValuator | ( | int | id | ) |
Returns value of the valuator identified by id from the tracker daemon.
SbBool SoControllerReader::isInitSuccess | ( | ) | [inline] |
Returns TRUE if Inventor was able to retrieve all the trackdAPI functions.
SbBool SoControllerReader::isLoadSuccess | ( | ) | [inline] |
Returns TRUE if libtrackd.so was loaded successfully.