From 02132de7aadee611c8641f01fa44efdf43f54cc4 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 23 Jun 2008 20:41:18 +0000 Subject: 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. --- source/blender/src/buttons_logic.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source/blender/src') 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) -- cgit v1.2.3