diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-04-07 10:23:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-04-07 10:23:45 +0400 |
commit | 885fa49aa4cd49a552bfe6210e3cb4701c4a5d04 (patch) | |
tree | a92028138d51c136190dceaaaf600a58246c823c /source/blender/makesdna | |
parent | 816a9f3acb47f97d5bf92ae7ae8803e31f4a9f0a (diff) |
BGE Joystick Sensor
- Raised limit of 2 axis to 4 axis pairs (4==8 joysticks axis pairs)
- Added a new Joystick Sensor type "Single Axis", so you can detect horizontal or vertical movement, rather then just Up/Down/Left/Right
- added Python attribute "axisSingle" so you can get the value from the selected axis (rather then getting it out of the axis list)
- renamed Py attribute "axisPosition" to "axisValues" (was never in a release)
If we need to increase the axis limit again just change JOYAXIS_MAX and the button limits.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_sensor_types.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h index 2cae2cc8ccb..7a358ad0694 100644 --- a/source/blender/makesdna/DNA_sensor_types.h +++ b/source/blender/makesdna/DNA_sensor_types.h @@ -166,7 +166,8 @@ typedef struct bJoystickSensor { char type; char joyindex; short flag; - int axis; + short axis; + short axis_single; int axisf; int button; int hat; @@ -255,20 +256,22 @@ typedef struct bJoystickSensor { #define SENS_JOY_ANY_EVENT 1 -#define SENS_JOY_BUTTON 0 +#define SENS_JOY_BUTTON 0 /* axis type */ #define SENS_JOY_BUTTON_PRESSED 0 #define SENS_JOY_BUTTON_RELEASED 1 -#define SENS_JOY_AXIS 1 +#define SENS_JOY_AXIS 1 /* axis type */ #define SENS_JOY_X_AXIS 0 #define SENS_JOY_Y_AXIS 1 #define SENS_JOY_NEG_X_AXIS 2 #define SENS_JOY_NEG_Y_AXIS 3 #define SENS_JOY_PRECISION 4 -#define SENS_JOY_HAT 2 +#define SENS_JOY_HAT 2 /* axis type */ #define SENS_JOY_HAT_DIR 0 +#define SENS_JOY_AXIS_SINGLE 3 /* axis type */ + #define SENS_DELAY_REPEAT 1 // should match JOYINDEX_MAX in SCA_JoystickDefines.h */ |