#include <bodies.h>

Public Member Functions | |
| ~ButtonDevice () | |
| destructor | |
| virtual int | Button (int num) |
| Specifies whether button is pressed or not. | |
| virtual int | ButonsNumber () |
| Returns number of buttons (8 is returned for all clases derived from this). | |
| virtual int | ButtonsMask32 () |
| returns mask of first 32 buttons | |
| ~ButtonDevice () | |
| destructor | |
| virtual int | Button (int num) |
| Specifies whether button is pressed or not. | |
| virtual int | ButonsNumber () |
| Returns number of buttons (8 is returned for all clases derived from this). | |
| virtual int | ButtonsMask32 () |
| returns mask of first 32 buttons | |
Protected Member Functions | |
| ButtonDevice (BodyType type, int id, float qu, int buttons, float *shift=NULL, float *rotation=NULL) | |
| constructor of the class | |
| ButtonDevice (BodyType type, int id, float qu, int buttons, float *shift=NULL, float *rotation=NULL) | |
| constructor of the class | |
Protected Attributes | |
| int | buttons |
| Binary coded buttons configuration. | |
Definition at line 197 of file bodies.h.
| ButtonDevice::ButtonDevice | ( | Body::BodyType | type, | |
| int | id, | |||
| float | qu, | |||
| int | buttons, | |||
| float * | shift = NULL, |
|||
| float * | rotation = NULL | |||
| ) | [protected] |
constructor of the class
| type | The type of the Device (see BodyType specification) | |
| id | Identificator of the device | |
| qu | Quality of device visibility | |
| buttons | Binary coded configuration of buttons (max 8 buttons) | |
| shift | Shift vector (constructor makes a copy) | |
| rotation | Rotation matrix of the device (constructor makes a copy) |
Definition at line 139 of file bodies.cpp.
| ButtonDevice::~ButtonDevice | ( | ) |
| ButtonDevice::ButtonDevice | ( | BodyType | type, | |
| int | id, | |||
| float | qu, | |||
| int | buttons, | |||
| float * | shift = NULL, |
|||
| float * | rotation = NULL | |||
| ) | [protected] |
constructor of the class
| type | The type of the Device (see BodyType specification) | |
| id | Identificator of the device | |
| qu | Quality of device visibility | |
| buttons | Binary coded configuration of buttons (max 8 buttons) | |
| shift | Shift vector (constructor makes a copy) | |
| rotation | Rotation matrix of the device (constructor makes a copy) |
| ButtonDevice::~ButtonDevice | ( | ) |
destructor
| int ButtonDevice::Button | ( | int | num | ) | [virtual] |
Specifies whether button is pressed or not.
| num | - index to array, so use just values from 0 to 7 Returns 1 if button is pressed Returns 0 if button is not pressed Returns -10 if button is not in scope or device is not equiped with buttons |
Reimplemented from Body.
Definition at line 150 of file bodies.cpp.
00151 { 00152 int res = 0x01; 00153 if (0<=num && num < 8) 00154 { 00155 res = res << num; // shift mask num positions to left 00156 if (0 != (res & buttons)) return 1; 00157 else return 0; 00158 } 00159 else return -10; 00160 }
| int ButtonDevice::ButonsNumber | ( | ) | [virtual] |
Returns number of buttons (8 is returned for all clases derived from this).
Reimplemented from Body.
Definition at line 146 of file bodies.cpp.
| int ButtonDevice::ButtonsMask32 | ( | ) | [virtual] |
returns mask of first 32 buttons
Reimplemented from Body.
Definition at line 229 of file bodies.cpp.
00230 { 00231 return this->buttons; 00232 }
| virtual int ButtonDevice::Button | ( | int | num | ) | [virtual] |
Specifies whether button is pressed or not.
| num | - index to array, so use just values from 0 to 7 Returns 1 if button is pressed Returns 0 if button is not pressed Returns -10 if button is not in scope or device is not equiped with buttons |
Reimplemented from Body.
| virtual int ButtonDevice::ButonsNumber | ( | ) | [virtual] |
Returns number of buttons (8 is returned for all clases derived from this).
Reimplemented from Body.
| virtual int ButtonDevice::ButtonsMask32 | ( | ) | [virtual] |
int ButtonDevice::buttons [protected] |
1.5.5