Blender Git Commit Log

Git Commits -> Revision be2c21b

Revision be2c21b by Benoit Bolsee (master)
May 4, 2009, 22:21 (GMT)
BGE logic: new sensor "tap" option to generate automatically on/off pulses

When enabled, this option converts any positive trigger from the sensor
into a pair of positive+negative trigger, with the negative trigger sent
in the next frame. The negative trigger from the sensor are not passed
to the controller as the option automatically generates the negative triggers.
From the controller point of view, the sensor is positive only for 1 frame,
even if the underlying sensor state remains positive.

The option interacts with the other sensor option in this way:
- Level option: tap option is mutually exclusive with level option. Both
cannot be enabled at the same time.
- Invert option: tap option operates on the negative trigger of the
sensor, which are converted to positive trigger by the invert option.
Hence, the controller will see the sensor positive for 1 frame when
the underlying sensor state turns negative.
- Positive pulse option: tap option adds a negative trigger after each
repeated positive pulse, unless the frequency option is 0, in which case
positive pulse are generated on every frame as before, as long as the
underlying sensor state is positive.
- Negative pulse option: this option is not compatible with tap option
and is ignored when tap option is enabled.

Notes:
- Keyboard "All keys" is handled specially when tap option is set:
There will be one pair of positive/negative trigger for each new
key press, regardless on how many keys are already pressed and there
is no trigger when keys are released, regardless if keys are still
pressed.
In case two keys are pressed in succesive frames, there will
be 2 positive triggers and 1 negative trigger in the following frame.

Commit Details:

Full Hash: be2c21bcdb2a05fa238cb637940269941a5fc12c
SVN Revision: 20064
Parent Commit: e29e329
Lines Changed: +126, -30

13 Modified Paths:

/source/blender/makesdna/DNA_sensor_types.h (+2, -1) (Diff)
/source/blender/src/buttons_logic.c (+29, -7) (Diff)
/source/gameengine/Converter/KX_ConvertSensors.cpp (+3, -0) (Diff)
/source/gameengine/GameLogic/SCA_ANDController.cpp (+1, -1) (Diff)
/source/gameengine/GameLogic/SCA_ExpressionController.cpp (+1, -1) (Diff)
/source/gameengine/GameLogic/SCA_ISensor.cpp (+64, -14) (Diff)
/source/gameengine/GameLogic/SCA_ISensor.h (+18, -1) (Diff)
/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp (+3, -0) (Diff)
/source/gameengine/GameLogic/SCA_NANDController.cpp (+1, -1) (Diff)
/source/gameengine/GameLogic/SCA_NORController.cpp (+1, -1) (Diff)
/source/gameengine/GameLogic/SCA_ORController.cpp (+1, -1) (Diff)
/source/gameengine/GameLogic/SCA_XNORController.cpp (+1, -1) (Diff)
/source/gameengine/GameLogic/SCA_XORController.cpp (+1, -1) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021