Controller
Previous  Top  Next


The values of the buttons and/or valuators on the WAND (or other control device) are stored in the global structure pointed to by CAVEController. The typical WAND has three or four buttons and a joystick (which consists of two valuators - the X & Y position); there are macros for getting these values. The macros are CAVEBUTTON1, CAVEBUTTON2, CAVEBUTTON3, CAVEBUTTON4, CAVE_JOYSTICK_X, and CAVE_JOYSTICK_Y. (Note: the macro numbering of the buttons start from 1, rather than 0, so CAVEBUTTON1 corresponds to CAVEController->button[0], etc.)

The values in CAVEController structure reflect the current state of the buttons and valuators; the function CAVEButtonChange() is an additional feature that can be used to find out how a button state has changed since the last time it was checked. The argument for CAVEButtonChange() uses the same numbering as used by the CAVEBUTTON macros. For further information see the chapter "Functions, Data Types & Macros".