home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Zone
/
VRZONE.ISO
/
mac
/
PC
/
PCGLOVE
/
GLOVE
/
GLOVE.H
< prev
next >
Wrap
Text File
|
1991-11-07
|
2KB
|
47 lines
/***** GLOVE DATA SPECIFICATIONS **************
The glove_data array has been simplified. These are its functions:
x = X position, 3mm per number
y = Y position, 3mm per number
z = distance, 14mm per number
rot = wrist twist. 0 is up 1 is slightly CW, 5 is down, 11 is slightly CCW.
About 30 to 40 degrees per count.
Note: exact scaling of all above change with distance! Closer is higher res.
fingers = packed 2-bit values, 0 is open, 3 is (tight) fist:
Bit format: TtIiMmRr for Thumb, Index, Middle, and Ring fingers.
keys: $FF or $80 is no key. Responds with 0 to 9 for keys "0" thru "9"
$82 = START, $83 = SEL, $0A = "A", $0B = "B", 0 is "Center"
Up,down,left,right are $0D,$0E,$0C,$0F respectively.
*/
typedef struct glove_data {
signed char x,y,z,rot,fingers,keys;
unsigned int nmissed; /* number of samples missed */
} glove_data;
/* prototypes */
void Hires (void); /* puts glove in hires mode */
void getglove (glove_data *); /* get data packet from glove */
int glove_ready(void); /* returns 0 if not ready */
void glove_delay(void); /* delay required between polls */
int glove_init(int mode, void (*function)()); /* returns actual mode used */
int glove_read(glove_data *glov); /* reads glove data, with de-glitching */
void glove_quit(void); /* release the glove */
/* Modes passed to glove_init */
#define LORES 0 /* polled low-resolution */
#define HIRES 1 /* polled high-resolution */
#define ILORES 2 /* interrupt-driven low-resolution */
#define IHIRES 3 /* interrupt-driven high-resolution */
/* End of glove.h */