diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-06-24 00:41:18 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-06-24 00:41:18 +0400 |
commit | 02132de7aadee611c8641f01fa44efdf43f54cc4 (patch) | |
tree | ce6314b7c61fe1758383876b6cc2f9f8c5a2b6b0 /source/blender | |
parent | 10c57fd86e0d42fe5e9f1928598e4642aa778e89 (diff) |
BGE patch: Add NAND, NOR, XOR, XNOR controllers.
NAND controller is an inverted AND controller: the output is
1 if any of the input is 0.
NOR controller is an inverted OR controller: the output is 0
if any of the input is 1.
XOR controller is an exclusive OR: the output is 1 if and only
if one input is 1 and all the other inputs are 0.
XNOR controller is an inverted XOR: the output is 0 if and only
if one input is 0 and all the other inputs are 0.
The NAND, NORT and XNOR controllers are very usefull to create
complementary outputs to start and stop actuators synchronously.
MSCV project files updated.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesdna/DNA_controller_types.h | 4 | ||||
-rw-r--r-- | source/blender/src/buttons_logic.c | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_controller_types.h b/source/blender/makesdna/DNA_controller_types.h index cc9215e7d14..376f95b0145 100644 --- a/source/blender/makesdna/DNA_controller_types.h +++ b/source/blender/makesdna/DNA_controller_types.h @@ -66,6 +66,10 @@ typedef struct bController { #define CONT_LOGIC_OR 1 #define CONT_EXPRESSION 2 #define CONT_PYTHON 3 +#define CONT_LOGIC_NAND 4 +#define CONT_LOGIC_NOR 5 +#define CONT_LOGIC_XOR 6 +#define CONT_LOGIC_XNOR 7 /* controller->flag */ #define CONT_SHOW 1 diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index e7933c10162..bfa451428c3 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -740,6 +740,14 @@ static char *controller_name(int type) return "AND"; case CONT_LOGIC_OR: return "OR"; + case CONT_LOGIC_NAND: + return "NAND"; + case CONT_LOGIC_NOR: + return "NOR"; + case CONT_LOGIC_XOR: + return "XOR"; + case CONT_LOGIC_XNOR: + return "XNOR"; case CONT_EXPRESSION: return "Expression"; case CONT_PYTHON: @@ -750,7 +758,7 @@ static char *controller_name(int type) static char *controller_pup(void) { - return "Controllers %t|AND %x0|OR %x1|Expression %x2|Python %x3"; + return "Controllers %t|AND %x0|OR %x1|XOR %x6|NAND %x4|NOR %x5|XNOR %x7|Expression %x2|Python %x3"; } static char *actuator_name(int type) @@ -1066,6 +1074,10 @@ static void draw_default_sensor_header(bSensor *sens, (short)(x + 10 + 0.85 * (w-20)), (short)(y - 19), (short)(0.15 * (w-20)), 19, &sens->invert, 0.0, 0.0, 0, 0, "Invert the level (output) of this sensor"); + uiDefButS(block, TOG, 1, "Lvl", + (short)(x + 10 + 0.70 * (w-20)), (short)(y - 19), (short)(0.15 * (w-20)), 19, + &sens->level, 0.0, 0.0, 0, 0, + "Level detector versus edge detector (only applicable in case of logic state transition)"); } static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short yco, short width,char* objectname) |