diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-06-24 00:26:48 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-06-24 00:26:48 +0400 |
commit | 67c0b32375c9c2f9838cf110975d7fce9d783daa (patch) | |
tree | 15ab22166395d90765f6f43ce4bfbc7f0c2c472f /source/gameengine/GameLogic/SCA_ISensor.h | |
parent | 8b9503e0ecb9c1f524278df0fafda409425b21da (diff) |
BGE patch: Add level option on sensor and fix sensor reset.
Level option is now available on all sensors but is only implemented on
mouse and keyboard sensors. The purpose of that option is to make
the sensor react on level rather than edge by default. It's only
applicable to state engine system when there is a state transition:
the sensor will generate a pulse if the condition is met from the
start of the state. Normally, the keyboard sensor generate a pulse
only when the key is pressed and not when the key is already pressed.
This patch allows to select this behavior.
The second part of the patch corrects the reset method for sensors
with inverted output.
Diffstat (limited to 'source/gameengine/GameLogic/SCA_ISensor.h')
-rw-r--r-- | source/gameengine/GameLogic/SCA_ISensor.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 292b2d160ae..3527b87ebdb 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -61,6 +61,9 @@ class SCA_ISensor : public SCA_ILogicBrick /** invert the output signal*/ bool m_invert; + /** detect level instead of edge*/ + bool m_level; + /** Sensor must ignore updates? */ bool m_suspended; @@ -105,6 +108,8 @@ public: virtual void Delete() { Release(); } /** Set inversion of pulses on or off. */ void SetInvert(bool inv); + /** set the level detection on or off */ + void SetLevel(bool lvl); void RegisterToManager(); virtual float GetNumber(); @@ -134,6 +139,8 @@ public: KX_PYMETHOD_DOC(SCA_ISensor,SetUseNegPulseMode); KX_PYMETHOD_DOC(SCA_ISensor,GetInvert); KX_PYMETHOD_DOC(SCA_ISensor,SetInvert); + KX_PYMETHOD_DOC(SCA_ISensor,GetLevel); + KX_PYMETHOD_DOC(SCA_ISensor,SetLevel); }; |