diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-06-26 13:15:41 +0400 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-06-26 13:15:41 +0400 |
commit | 4c53f38756976704bab11a3dd8c33c71d926e6b8 (patch) | |
tree | 5db17347afbc71062a77f01f1197a9bfe7f0c20d /source/gameengine/PyDoc/GameLogic.py | |
parent | f69cc652e283bfa1958ae6945b0a014eb7d50906 (diff) |
Minor Fixes:
Better use of booleans for python
#include fixes for Windows
Python Doc fixes
Use the farthest vertex as the face position when z sorting faces. (Camera is on -z axis!)
Diffstat (limited to 'source/gameengine/PyDoc/GameLogic.py')
-rw-r--r-- | source/gameengine/PyDoc/GameLogic.py | 137 |
1 files changed, 90 insertions, 47 deletions
diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 08f71e50f97..d4fccc7c3a0 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -17,65 +17,108 @@ Documentation for the GameLogic Module. # To get the game object associated with this controller: obj = co.getOwner() - L{KX_GameObject} and possibly L{KX_Camera} and L{KX_Light} methods are + L{KX_GameObject} and L{KX_Camera} or L{KX_Light} methods are available depending on the type of object:: # To get a sensor linked to this controller. # "sensorname" is the name of the sensor as defined in the Blender interface. + # +---------------------+ +--------+ + # | Sensor "sensorname" +--+ Python + + # +---------------------+ +--------+ sens = co.getSensor("sensorname") - L{KX_NetworkMessageSensor}, L{KX_RaySensor}, L{KX_TouchSensor}, L{SCA_KeyboardSensor}, - L{SCA_MouseSensor}, L{SCA_PropertySensor} and L{SCA_RandomSensor} methods are available, - depending on the type of sensor:: + # To get a list of all sensors: - sensors = co.B{getSensors}() + sensors = co.getSensors() + + See the sensor's reference for available methods: + - L{KX_NetworkMessageSensor} + - L{KX_RaySensor} + - L{KX_MouseFocusSensor} + - L{KX_NearSensor} + - L{KX_RadarSensor} + - L{KX_TouchSensor} + - L{SCA_KeyboardSensor} + - L{SCA_MouseSensor} + - L{SCA_PropertySensor} + - L{SCA_RandomSensor} + + You can also access actuators linked to the controller:: + # To get an actuator attached to the controller: + # +--------+ +-------------------------+ + # + Python +--+ Actuator "actuatorname" | + # +--------+ +-------------------------+ + actuator = co.getActuator("actuatorname") + + # Activate an actuator + GameLogic.addActiveActuator(actuator, True) + + See the actuator's reference for available methods: + - L{BL_ActionActuator} + - L{KX_CameraActuator} + - L{KX_CDActuator} + - L{KX_ConstraintActuator} + - L{KX_GameActuator} + - L{KX_IpoActuator} + - L{KX_NetworkMessageActuator} + - L{KX_ObjectActuator} + - L{KX_SCA_AddObjectActuator} + - L{KX_SCA_EndObjectActuator} + - L{KX_SCA_ReplaceMeshActuator} + - L{KX_SceneActuator} + - L{KX_SoundActuator} + - L{KX_TrackToActuator} + - L{KX_VisibilityActuator} + - L{SCA_PropertyActuator} + - L{SCA_RandomActuator} + + There are also methods to access the current L{KX_Scene}:: + # Get the current scene + scene = GameLogic.getCurrentScene() + + # Get the current camera + cam = scene.active_camera + Matricies as used by the game engine are B{row major}:: + matrix[row][col] = blah + L{KX_Camera} has some examples using matricies. -Constants -========= - - KX_TRUE: True value used by some modules - - KX_FALSE: False value used by some modules. +@group Constants: KX_TRUE, KX_FALSE +@var KX_TRUE: True value used by some modules. +@var KX_FALSE: False value used by some modules. -Property Sensor ---------------- - Tests that the property sensor is able to perform. See L{SCA_PropertySensor} - - KX_PROPSENSOR_EQUAL: Activate when the property is equal to the sensor value. - - KX_PROPSENSOR_NOTEQUAL: Activate when the property is not equal to the sensor value. - - KX_PROPSENSOR_INTERVAL: Activate when the property is between the specified limits. - - KX_PROPSENSOR_CHANGED: Activate when the property changes - - KX_PROPSENSOR_EXPRESSION: Activate when the expression matches +@group Property Sensor: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, KX_PROPSENSOR_EXPRESSION +@var KX_PROPSENSOR_EQUAL: Activate when the property is equal to the sensor value. +@var KX_PROPSENSOR_NOTEQUAL: Activate when the property is not equal to the sensor value. +@var KX_PROPSENSOR_INTERVAL: Activate when the property is between the specified limits. +@var KX_PROPSENSOR_CHANGED: Activate when the property changes +@var KX_PROPSENSOR_EXPRESSION: Activate when the expression matches -Constraint Actuator -------------------- - The axis and type (location/rotation) of constraint. See L{KX_ConstraintActuator} - - KX_CONSTRAINTACT_LOCX - - KX_CONSTRAINTACT_LOCY - - KX_CONSTRAINTACT_LOCZ - - KX_CONSTRAINTACT_ROTX - - KX_CONSTRAINTACT_ROTY - - KX_CONSTRAINTACT_ROTZ +@group Constraint Actuator: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ, KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY, KX_CONSTRAINTACT_ROTZ +@var KX_CONSTRAINTACT_LOCX: See L{KX_ConstraintActuator} +@var KX_CONSTRAINTACT_LOCY: See L{KX_ConstraintActuator} +@var KX_CONSTRAINTACT_LOCZ: See L{KX_ConstraintActuator} +@var KX_CONSTRAINTACT_ROTX: See L{KX_ConstraintActuator} +@var KX_CONSTRAINTACT_ROTY: See L{KX_ConstraintActuator} +@var KX_CONSTRAINTACT_ROTZ: See L{KX_ConstraintActuator} -IPO Actuator ------------- - IPO Types. See L{KX_IpoActuator} - - KX_IPOACT_PLAY - - KX_IPOACT_PINGPONG - - KX_IPOACT_FLIPPER - - KX_IPOACT_LOOPSTOP - - KX_IPOACT_LOOPEND +@group IPO Actuator: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND +@var KX_IPOACT_PLAY: See L{KX_IpoActuator} +@var KX_IPOACT_PINGPONG: See L{KX_IpoActuator} +@var KX_IPOACT_FLIPPER: See L{KX_IpoActuator} +@var KX_IPOACT_LOOPSTOP: See L{KX_IpoActuator} +@var KX_IPOACT_LOOPEND: See L{KX_IpoActuator} -Random Distributions --------------------- - See L{SCA_RandomActuator} - - KX_RANDOMACT_BOOL_CONST - - KX_RANDOMACT_BOOL_UNIFORM - - KX_RANDOMACT_BOOL_BERNOUILLI - - KX_RANDOMACT_INT_CONST - - KX_RANDOMACT_INT_UNIFORM - - KX_RANDOMACT_INT_POISSON - - KX_RANDOMACT_FLOAT_CONST - - KX_RANDOMACT_FLOAT_UNIFORM - - KX_RANDOMACT_FLOAT_NORMAL - - KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL +@group Random Distributions: KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI, KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON, KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL, KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL +@var KX_RANDOMACT_BOOL_CONST: See L{SCA_RandomActuator} +@var KX_RANDOMACT_BOOL_UNIFORM: See L{SCA_RandomActuator} +@var KX_RANDOMACT_BOOL_BERNOUILLI: See L{SCA_RandomActuator} +@var KX_RANDOMACT_INT_CONST: See L{SCA_RandomActuator} +@var KX_RANDOMACT_INT_UNIFORM: See L{SCA_RandomActuator} +@var KX_RANDOMACT_INT_POISSON: See L{SCA_RandomActuator} +@var KX_RANDOMACT_FLOAT_CONST: See L{SCA_RandomActuator} +@var KX_RANDOMACT_FLOAT_UNIFORM: See L{SCA_RandomActuator} +@var KX_RANDOMACT_FLOAT_NORMAL: See L{SCA_RandomActuator} +@var KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL: See L{SCA_RandomActuator} """ |