Data types


The following data types are defined in cave.h and are used for various CAVE function arguments or global variables.

CAVE_WALL_ID - an enumerated type for identifying the different walls available in the CAVE, with values such as CAVE_FRONT_WALL,
CAVE_SCREEN0_WALL,
CAVE_SIMULATOR_WALL
, etc. There is a distinct value for each wall which can be selected by the "Walls" configuration option.

CAVEID - an enumerated type for most identifier constants other than wall names.

CAVE_SENSOR_ST - a structure containing tracker sensor data. The entries are:
  • float x,y,z - the position of the sensor
  • float azim,elev,roll - the orientation of the sensor (Euler angles)
  • CAVE_TIMESTAMP_ST timestamp - the time that the most recent reading for this sensor was taken. The CAVE_TIMESTAMP_ST struct is similar to a struct timeval, with entries sec and usec.
  • boolean calibrated - a flag indicating whether the current sensor data has been calibrated (see the CalibrationFile config option)
  • CAVEID frame - the frame of reference for this data; either CAVE_TRACKER_FRAME or CAVE_NAV_FRAME
The orientation values are in degrees; azim and roll range from -180 to 180, and elev ranges from -90 to 90. The order of the rotations is azim (Y), elev (X), roll (Z).

CAVE_CONTROLLER_ST - a structure containing controller status information. The entries are:
  • int num_buttons - number of buttons on the controller
  • int button[] - state of each button
  • int num_valuators - number of valuators on the controller
  • float valuator[] - state of each valuator

CAVENETID - a unique ID for a networked CAVE user

CAVE_USER_ST - a structure containing data for a networked user. The structure entries are:
  • CAVENETID id - the user's ID
  • float timestamp - the last time data was received from this user (in local CAVE time)
  • int num_sensors - the number of tracker sensors
  • CAVE_SENSOR_ST sensor[] - the user's tracking data; sensor[0] contains the head data; the remaining entries contain the data for the wand and other tracked devices
  • CAVE_CONTROLLER_ST controller - the user's controller data (buttons & valuators)
  • void *app_data - a pointer which can be used to store application data associated with the user. The library does not touch this entry except to zero it when a new user is initialized.

CAVELOCK - an IPC lock, as returned by CAVENewLock and used by CAVESetReadLock, etc.
CAVECALLBACK - a pointer to a callback function (i.e. void (*)())

CAVE_ST - a structure containing pointers to all the library data for the CAVE. Some of the data are stored in shared memory; their entries are therefore pointers, as the CAVE_ST structure itself is not shared. The structure entries include:
  • int num_sensors - the number of sensors being tracked
  • CAVE_SENSOR_ST *sensor[] - the data from the tracker sensors
  • CAVE_CONTROLLER_ST *controller - the controller status
  • float *time - the current CAVE time; this is updated once per display frame
  • float *framesPerSecond - the current frame rate
  • int *numUsers - the number of networked users
  • CAVE_USER_ST **user - an array of pointers to the networked users' data