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/gameengine/GameLogic/SCA_JoystickSensor.h | |
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/gameengine/GameLogic/SCA_JoystickSensor.h')
-rw-r--r-- | source/gameengine/GameLogic/SCA_JoystickSensor.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index f8a3eb8756a..cf3e7e74414 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -93,6 +93,7 @@ class SCA_JoystickSensor :public SCA_ISensor KX_JOYSENSORMODE_AXIS, KX_JOYSENSORMODE_BUTTON, KX_JOYSENSORMODE_HAT, + KX_JOYSENSORMODE_AXIS_SINGLE, KX_JOYSENSORMODE_MAX }; bool isValid(KX_JOYSENSORMODE); @@ -148,7 +149,8 @@ public: KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfHats); KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,Connected); - static PyObject* pyattr_get_axis_position(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_num_buttons(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_num_hats(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); |