Trackers
Previous  Top  Next


In the past, the library supported exactly two tracker sensors - one for the user's head, and one for the wand - and much of the API reflects this legacy, although the current CAVELib supports up to 32 sensors. The sensor data is accessible through a global structure pointed to by CAVEptr; the number of sensors being read is obtained from CAVEptr->num_sensors, and the array CAVEptr->sensor[] contains pointers to the data for each sensor. CAVESENSOR(i) is a macro that returns a pointer to the i'th sensor. The first sensor, CAVEptr->sensor[0] is always the sensor used for the user's head position and orientation and in calculating the view perspective and matrices. The remaining sensors are the controller or whatever other objects are being tracked.

The functions for getting tracker-related values are:

·CAVEGetPosition(id,pos)  
·CAVEGetOrientation(id,or)  
·CAVEGetVector(id,vec)  
·CAVEGetSensorPosition(sensor,coords,pos)  
·CAVEGetSensorOrientation(sensor,coords,or)  
·CAVEGetSensorVector(sensor,id,vec)  

CAVEGetPosition()
, CAVEGetOrientation(), and CAVEGetVector() functions return values for either the head or the wand, based on the id argument. CAVEGetSensorPosition(), CAVEGetSensorOrientation(), and CAVEGetSensorVector() functions return values for the sensor pointed to by the sensor argument. These functions can return values either in the coordinate system of the physical CAVE, or in the application's world coordinate system, as defined by the navigation matrix. For further information see the chapter "Functions, Data Types & Macros".