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.
This commit is contained in:
Benoit Bolsee
2008-06-23 20:41:18 +00:00
parent 10c57fd86e
commit 02132de7aa
13 changed files with 878 additions and 2 deletions

View File

@@ -35,6 +35,10 @@
// Controller
#include "SCA_ANDController.h"
#include "SCA_ORController.h"
#include "SCA_NANDController.h"
#include "SCA_NORController.h"
#include "SCA_XORController.h"
#include "SCA_XNORController.h"
#include "SCA_PythonController.h"
#include "SCA_ExpressionController.h"
@@ -112,6 +116,30 @@ void BL_ConvertControllers(
LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter);
break;
}
case CONT_LOGIC_NAND:
{
gamecontroller = new SCA_NANDController(gameobj);
LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter);
break;
}
case CONT_LOGIC_NOR:
{
gamecontroller = new SCA_NORController(gameobj);
LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter);
break;
}
case CONT_LOGIC_XOR:
{
gamecontroller = new SCA_XORController(gameobj);
LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter);
break;
}
case CONT_LOGIC_XNOR:
{
gamecontroller = new SCA_XNORController(gameobj);
LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter);
break;
}
case CONT_EXPRESSION:
{
bExpressionCont* bexpcont = (bExpressionCont*) bcontr->data;