Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2009-05-05 02:21:02 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2009-05-05 02:21:02 +0400
commitbe2c21bcdb2a05fa238cb637940269941a5fc12c (patch)
treeb5de269198fa9e5ad15e677067666e9e9f38d037 /source/blender/makesdna/DNA_sensor_types.h
parente29e329885aa582316b70e13be2e4a05fe32fefc (diff)
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.
Diffstat (limited to 'source/blender/makesdna/DNA_sensor_types.h')
-rw-r--r--source/blender/makesdna/DNA_sensor_types.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h
index 7a358ad0694..8b29ce1338d 100644
--- a/source/blender/makesdna/DNA_sensor_types.h
+++ b/source/blender/makesdna/DNA_sensor_types.h
@@ -158,7 +158,8 @@ typedef struct bSensor {
/* just add here, to avoid align errors... */
short invert; /* Whether or not to invert the output. */
short level; /* Whether the sensor is level base (edge by default) */
- int pad;
+ short tap;
+ short pad;
} bSensor;
typedef struct bJoystickSensor {