blender/source/gameengine
Benoit Bolsee 9b4956ae22 BGE patch: KX_STATEx constant to allow simple state manipulation in setState()
The constants KX_STATE1 to KX_STATE30 can be used 
with setState() to change the object state in a 
python controller. The constants are defined in the 
GameLogic module so that the full name is 
GameLogic.KX_STATE1 to GameLogic.KX_STATE30 but you
can simplify this with the import statement:

from GameLogic import *
cont = getCurrentController()
ob = cont.getOwner()
ob.setState(KX_STATE2)		#go to state 2

KX_STATEx constants are defined as (1<<(x-1))
Binary operators |, &, ^ and ~ can be used to combine states:

You can activate more than one state at a time with the | operator:

ob.setState(KX_STATE1|KX_STATE2)  #activate state 1 and 2, stop all others

You can add a state to the current state mask with:

state = ob.getState()
ob.setState(state|KX_STATE3)      #activate state 3, keep others

You can substract a state to the current state mask with the & and operator:

state = ob.getState()
ob.setState(state&~KX_STATE2)     #stop state 2, keep others

You can invert a state with the ^ operator:

state = ob.getState()
ob.setState(state^KX_STATE2)     #invert state 2, keep others
2008-09-22 19:54:30 +00:00
..
BlenderRoutines Fix zoom level and clipping to be consistent with the viewport 2008-09-15 00:11:30 +00:00
Converter BGE real-time soft bodies, step 2 / 3: create a btSoftBody. Next step is hooking up / deform graphics mesh and choose collision shape. 2008-09-21 15:17:50 +00:00
Expressions [#17600] char* -> const char* 2008-09-20 11:08:35 +00:00
GameLogic game engine now compiles with SDL disabled. CDROM and Joystick wont function in this case 2008-09-21 05:38:28 +00:00
GamePlayer [#17600] char* -> const char* 2008-09-20 11:08:35 +00:00
Ketsji BGE patch: KX_STATEx constant to allow simple state manipulation in setState() 2008-09-22 19:54:30 +00:00
Network Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
Physics BGE real-time soft bodies, step 2 / 3: create a btSoftBody. Next step is hooking up / deform graphics mesh and choose collision shape. 2008-09-21 15:17:50 +00:00
PyDoc Game engine: added Rasterizer.get/setMaterialMode to set texface, 2008-09-13 19:19:51 +00:00
Rasterizer [#17600] char* -> const char* 2008-09-20 11:08:35 +00:00
SceneGraph BGE patch: support for partial hierarchy in dupligroup instantiation; removal of links that point to inactive objects during group instantiation. 2008-07-18 19:56:56 +00:00
CMakeLists.txt Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
Makefile Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
SConscript == SCons == 2006-02-04 14:15:10 +00:00