diff options
Diffstat (limited to 'doc/python_api/rst/bge.logic.rst')
-rw-r--r-- | doc/python_api/rst/bge.logic.rst | 536 |
1 files changed, 419 insertions, 117 deletions
diff --git a/doc/python_api/rst/bge.logic.rst b/doc/python_api/rst/bge.logic.rst index 616ee12bba0..76e28c6d04b 100644 --- a/doc/python_api/rst/bge.logic.rst +++ b/doc/python_api/rst/bge.logic.rst @@ -260,13 +260,6 @@ General functions :rtype: list [float], len(getSpectrum()) == 512 -.. function:: stopDSP() - - Stops the sound driver using DSP effects. - - Only the fmod sound driver supports this. - DSP can be computationally expensive. - .. function:: getMaxLogicFrame() Gets the maximum number of logic frames per render frame. @@ -337,6 +330,24 @@ General functions .. warning: Not implimented yet +.. function:: getExitKey() + + Gets the key used to exit the game engine + + :return: The key (defaults to :mod:`bge.events.ESCKEY`) + :rtype: int + +.. function:: setExitKey(key) + + Sets the key used to exit the game engine + + :arg key: A key constant from :mod:`bge.events` + :type key: int + +.. function:: NextFrame() + + Render next frame (if Python has control) + ***************** Utility functions ***************** @@ -379,6 +390,10 @@ Utility functions .. function:: PrintGLInfo() Prints GL Extension Info into the console + +.. function:: PrintMemInfo() + + Prints engine statistics into the console ********* Constants @@ -407,6 +422,45 @@ Sensor Status .. data:: KX_SENSOR_ACTIVE .. data:: KX_SENSOR_JUST_DEACTIVATED +------------- +Armature Sensor +------------- + +.. _armaturesensor-type: + +See :class:`bge.types.KX_ArmatureSensor.type` + +.. data:: KX_ARMSENSOR_STATE_CHANGED + + Detect that the constraint is changing state (active/inactive) + + :value: 0 + +.. data:: KX_ARMSENSOR_LIN_ERROR_BELOW + + Detect that the constraint linear error is above a threshold + + :value: 1 + +.. data:: KX_ARMSENSOR_LIN_ERROR_ABOVE + + Detect that the constraint linear error is below a threshold + + :value: 2 + +.. data:: KX_ARMSENSOR_ROT_ERROR_BELOW + + Detect that the constraint rotation error is above a threshold + + :value: 3 + +.. data:: KX_ARMSENSOR_ROT_ERROR_ABOVE + + Detect that the constraint rotation error is below a threshold + + :value: 4 + + .. _logic-property-sensor: --------------- @@ -489,6 +543,52 @@ See :class:`bge.types.BL_ActionActuator` .. data:: KX_ACTIONACT_LOOPEND .. data:: KX_ACTIONACT_PROPERTY +--------------- +Armature Actuator +--------------- + + .. _armatureactuator-constants-type: + +See :class:`bge.types.BL_ArmatureActuator.type` + +.. data:: KX_ACT_ARMATURE_RUN + + Just make sure the armature will be updated on the next graphic frame. + This is the only persistent mode of the actuator: + it executes automatically once per frame until stopped by a controller + + :value: 0 + +.. data:: KX_ACT_ARMATURE_ENABLE + + Enable the constraint. + + :value: 1 + +.. data:: KX_ACT_ARMATURE_DISABLE + + Disable the constraint (runtime constraint values are not updated). + + :value: 2 + +.. data:: KX_ACT_ARMATURE_SETTARGET + + Change target and subtarget of constraint. + + :value: 3 + +.. data:: KX_ACT_ARMATURE_SETWEIGHT + + Change weight of constraint (IK only). + + :value: 4 + +.. data:: KX_ACT_ARMATURE_SETINFLUENCE + + Change influence of constraint. + + :value: 5 + ------------------- Constraint Actuator ------------------- @@ -499,31 +599,31 @@ See :class:`bge.types.KX_ConstraintActuator.option` * Applicable to Distance constraint: - .. data:: KX_ACT_CONSTRAINT_NORMAL +.. data:: KX_CONSTRAINTACT_NORMAL Activate alignment to surface - .. data:: KX_ACT_CONSTRAINT_DISTANCE +.. data:: KX_CONSTRAINTACT_DISTANCE Activate distance control - .. data:: KX_ACT_CONSTRAINT_LOCAL +.. data:: KX_CONSTRAINTACT_LOCAL Direction of the ray is along the local axis * Applicable to Force field constraint: - .. data:: KX_ACT_CONSTRAINT_DOROTFH +.. data:: KX_CONSTRAINTACT_DOROTFH Force field act on rotation as well * Applicable to both: - .. data:: KX_ACT_CONSTRAINT_MATERIAL +.. data:: KX_CONSTRAINTACT_MATERIAL Detect material rather than property - .. data:: KX_ACT_CONSTRAINT_PERMANENT +.. data:: KX_CONSTRAINTACT_PERMANENT No deactivation if ray does not hit target @@ -591,27 +691,27 @@ See :class:`bge.types.KX_ConstraintActuator.limit` Set orientation of Z axis -.. data:: KX_ACT_CONSTRAINT_FHNX +.. data:: KX_CONSTRAINTACT_FHNX Set force field along negative X axis -.. data:: KX_ACT_CONSTRAINT_FHNY +.. data:: KX_CONSTRAINTACT_FHNY Set force field along negative Y axis -.. data:: KX_ACT_CONSTRAINT_FHNZ +.. data:: KX_CONSTRAINTACT_FHNZ Set force field along negative Z axis -.. data:: KX_ACT_CONSTRAINT_FHPX +.. data:: KX_CONSTRAINTACT_FHPX Set force field along positive X axis -.. data:: KX_ACT_CONSTRAINT_FHPY +.. data:: KX_CONSTRAINTACT_FHPY Set force field along positive Y axis -.. data:: KX_ACT_CONSTRAINT_FHPZ +.. data:: KX_CONSTRAINTACT_FHPZ Set force field along positive Z axis @@ -714,101 +814,31 @@ See :class:`bge.types.KX_SoundActuator` .. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP :value: 6 - - -======= -Various -======= - -.. _input-status: - ------------- -Input Status ------------- - -See :class:`bge.types.SCA_PythonKeyboard`, :class:`bge.types.SCA_PythonMouse`, :class:`bge.types.SCA_MouseSensor`, :class:`bge.types.SCA_KeyboardSensor` - -.. data:: KX_INPUT_NONE -.. data:: KX_INPUT_JUST_ACTIVATED -.. data:: KX_INPUT_ACTIVE -.. data:: KX_INPUT_JUST_RELEASED - -------------- -Mouse Buttons -------------- - -See :class:`bge.types.SCA_MouseSensor` -.. data:: KX_MOUSE_BUT_LEFT -.. data:: KX_MOUSE_BUT_MIDDLE -.. data:: KX_MOUSE_BUT_RIGHT - ------- -States ------- +-------------- +Steering Actuator +-------------- -See :class:`bge.types.KX_StateActuator` +.. _logic-steering-actuator: -.. data:: KX_STATE1 -.. data:: KX_STATE2 -.. data:: KX_STATE3 -.. data:: KX_STATE4 -.. data:: KX_STATE5 -.. data:: KX_STATE6 -.. data:: KX_STATE7 -.. data:: KX_STATE8 -.. data:: KX_STATE9 -.. data:: KX_STATE10 -.. data:: KX_STATE11 -.. data:: KX_STATE12 -.. data:: KX_STATE13 -.. data:: KX_STATE14 -.. data:: KX_STATE15 -.. data:: KX_STATE16 -.. data:: KX_STATE17 -.. data:: KX_STATE18 -.. data:: KX_STATE19 -.. data:: KX_STATE20 -.. data:: KX_STATE21 -.. data:: KX_STATE22 -.. data:: KX_STATE23 -.. data:: KX_STATE24 -.. data:: KX_STATE25 -.. data:: KX_STATE26 -.. data:: KX_STATE27 -.. data:: KX_STATE28 -.. data:: KX_STATE29 -.. data:: KX_STATE30 +See :class:`bge.types.KX_SteeringActuator.behavior` -.. _state-actuator-operation: +.. data:: KX_STEERING_SEEK -See :class:`bge.types.KX_StateActuator.operation` + :value: 1 -.. data:: KX_STATE_OP_CLR +.. data:: KX_STEERING_FLEE - Substract bits to state mask - - :value: 0 + :value: 2 -.. data:: KX_STATE_OP_CPY +.. data:: KX_STEERING_PATHFOLLOWING - Copy state mask - - :value: 1 - -.. data:: KX_STATE_OP_NEG + :value: 3 - Invert bits to state mask - - :value: 2 - -.. data:: KX_STATE_OP_SET - Add bits to state mask - - :value: 3 - -.. _Two-D-FilterActuator-mode: +======= +Various +======= --------- 2D Filter @@ -883,6 +913,227 @@ See :class:`bge.types.KX_StateActuator.operation` .. data:: RAS_2DFILTER_SOBEL :value: 7 + +---------------- +Armature Channel +---------------- +.. _armaturechannel-constants-rotation-mode: + +See :class:`bge.types.BL_ArmatureChannel.rotation_mode` + +.. note: + euler mode are named as in Blender UI but the actual axis order is reversed + +.. data:: ROT_MODE_QUAT + + Use quaternion in rotation attribute to update bone rotation. + + :value: 0 + +.. data:: ROT_MODE_XYZ + + Use euler_rotation and apply angles on bone's Z, Y, X axis successively. + + :value: 1 + +.. data:: ROT_MODE_XZY + + Use euler_rotation and apply angles on bone's Y, Z, X axis successively. + + :value: 2 + +.. data:: ROT_MODE_YXZ + + Use euler_rotation and apply angles on bone's Z, X, Y axis successively. + + :value: 3 + +.. data:: ROT_MODE_YZX + + Use euler_rotation and apply angles on bone's X, Z, Y axis successively. + + :value: 4 + +.. data:: ROT_MODE_ZXY + + Use euler_rotation and apply angles on bone's Y, X, Z axis successively. + + :value: 5 + +.. data:: ROT_MODE_ZYX + + Use euler_rotation and apply angles on bone's X, Y, Z axis successively. + + :value: 6 + + +---------------- +Armature Constraint +---------------- +.. _armatureconstraint-constants-type: + +See :class:`bge.types.BL_ArmatureConstraint.type` + +.. data:: CONSTRAINT_TYPE_TRACKTO +.. data:: CONSTRAINT_TYPE_KINEMATIC +.. data:: CONSTRAINT_TYPE_ROTLIKE +.. data:: CONSTRAINT_TYPE_LOCLIKE +.. data:: CONSTRAINT_TYPE_MINMAX +.. data:: CONSTRAINT_TYPE_SIZELIKE +.. data:: CONSTRAINT_TYPE_LOCKTRACK +.. data:: CONSTRAINT_TYPE_STRETCHTO +.. data:: CONSTRAINT_TYPE_CLAMPTO +.. data:: CONSTRAINT_TYPE_TRANSFORM +.. data:: CONSTRAINT_TYPE_DISTLIMIT + +.. _armatureconstraint-constants-ik-type: + +See :class:`bge.types.BL_ArmatureConstraint.ik_type` + +.. data:: CONSTRAINT_IK_COPYPOSE + + constraint is trying to match the position and eventually the rotation of the target. + + :value: 0 + +.. data:: CONSTRAINT_IK_DISTANCE + + Constraint is maintaining a certain distance to target subject to ik_mode + + :value: 1 + +.. _armatureconstraint-constants-ik-flag: + +See :class:`bge.types.BL_ArmatureConstraint.ik_flag` + +.. data:: CONSTRAINT_IK_FLAG_TIP + + Set when the constraint operates on the head of the bone and not the tail + + :value: 1 + +.. data:: CONSTRAINT_IK_FLAG_ROT + + Set when the constraint tries to match the orientation of the target + + :value: 2 + +.. data:: CONSTRAINT_IK_FLAG_STRETCH + + Set when the armature is allowed to stretch (only the bones with stretch factor > 0.0) + + :value: 16 + +.. data:: CONSTRAINT_IK_FLAG_POS + + Set when the constraint tries to match the position of the target. + + :value: 32 + +.. _armatureconstraint-constants-ik-mode: + +See :class:`bge.types.BL_ArmatureConstraint.ik_mode` + +.. data:: CONSTRAINT_IK_MODE_INSIDE + + The constraint tries to keep the bone within ik_dist of target + + :value: 0 + +.. data:: CONSTRAINT_IK_MODE_OUTSIDE + + The constraint tries to keep the bone outside ik_dist of the target + + :value: 1 + +.. data:: CONSTRAINT_IK_MODE_ONSURFACE + + The constraint tries to keep the bone exactly at ik_dist of the target. + + :value: 2 + +.. _input-status: + +---------------- +Blender Material +---------------- + +.. data:: BL_DST_ALPHA +.. data:: BL_DST_COLOR +.. data:: BL_ONE +.. data:: BL_ONE_MINUS_DST_ALPHA +.. data:: BL_ONE_MINUS_DST_COLOR +.. data:: BL_ONE_MINUS_SRC_ALPHA +.. data:: BL_ONE_MINUS_SRC_COLOR +.. data:: BL_SRC_ALPHA +.. data:: BL_SRC_ALPHA_SATURATE +.. data:: BL_SRC_COLOR +.. data:: BL_ZERO + +------------ +Input Status +------------ + +See :class:`bge.types.SCA_PythonKeyboard`, :class:`bge.types.SCA_PythonMouse`, :class:`bge.types.SCA_MouseSensor`, :class:`bge.types.SCA_KeyboardSensor` + +.. data:: KX_INPUT_NONE +.. data:: KX_INPUT_JUST_ACTIVATED +.. data:: KX_INPUT_ACTIVE +.. data:: KX_INPUT_JUST_RELEASED + +------------ +KX_GameObject +----------- +.. _gameobject-playaction-mode: + +See :class:`bge.types.KX_GameObject.playAction` + +.. data:: KX_ACTION_MODE_PLAY + + Play the action once. + + :value: 0 + +.. data:: KX_ACTION_MODE_LOOP + + Loop the action (repeat it). + + :value: 1 + +.. data:: KX_ACTION_MODE_PING_PONG + + Play the action one direct then back the other way when it has completed. + + :value: 2 + + +------------- +Mouse Buttons +------------- + +See :class:`bge.types.SCA_MouseSensor` + +.. data:: KX_MOUSE_BUT_LEFT +.. data:: KX_MOUSE_BUT_MIDDLE +.. data:: KX_MOUSE_BUT_RIGHT + +------------ +Navigation Mesh Draw Modes +------------ + +.. _navmesh-draw-mode: + +.. data:: RM_WALLS + + Draw only the walls. + +.. data:: RM_POLYS + + Draw only polygons. + +.. data:: RM_TRIS + + Draw triangle mesh. ------ Shader @@ -910,18 +1161,69 @@ Shader .. data:: SHD_TANGENT ----------------- -Blender Material ----------------- +------ +States +------ -.. data:: BL_DST_ALPHA -.. data:: BL_DST_COLOR -.. data:: BL_ONE -.. data:: BL_ONE_MINUS_DST_ALPHA -.. data:: BL_ONE_MINUS_DST_COLOR -.. data:: BL_ONE_MINUS_SRC_ALPHA -.. data:: BL_ONE_MINUS_SRC_COLOR -.. data:: BL_SRC_ALPHA -.. data:: BL_SRC_ALPHA_SATURATE -.. data:: BL_SRC_COLOR -.. data:: BL_ZERO +See :class:`bge.types.KX_StateActuator` + +.. data:: KX_STATE1 +.. data:: KX_STATE2 +.. data:: KX_STATE3 +.. data:: KX_STATE4 +.. data:: KX_STATE5 +.. data:: KX_STATE6 +.. data:: KX_STATE7 +.. data:: KX_STATE8 +.. data:: KX_STATE9 +.. data:: KX_STATE10 +.. data:: KX_STATE11 +.. data:: KX_STATE12 +.. data:: KX_STATE13 +.. data:: KX_STATE14 +.. data:: KX_STATE15 +.. data:: KX_STATE16 +.. data:: KX_STATE17 +.. data:: KX_STATE18 +.. data:: KX_STATE19 +.. data:: KX_STATE20 +.. data:: KX_STATE21 +.. data:: KX_STATE22 +.. data:: KX_STATE23 +.. data:: KX_STATE24 +.. data:: KX_STATE25 +.. data:: KX_STATE26 +.. data:: KX_STATE27 +.. data:: KX_STATE28 +.. data:: KX_STATE29 +.. data:: KX_STATE30 + +.. _state-actuator-operation: + +See :class:`bge.types.KX_StateActuator.operation` + +.. data:: KX_STATE_OP_CLR + + Substract bits to state mask + + :value: 0 + +.. data:: KX_STATE_OP_CPY + + Copy state mask + + :value: 1 + +.. data:: KX_STATE_OP_NEG + + Invert bits to state mask + + :value: 2 + +.. data:: KX_STATE_OP_SET + + Add bits to state mask + + :value: 3 + +.. _Two-D-FilterActuator-mode: |