From f840bd4a9f89815ca213d8398c99865fc6d64e4c Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sun, 4 Nov 2012 20:56:02 +0000 Subject: BGE: This patch adds a character wrapper (similar to the already implemented vehicle wrapper) to control character physics options. Currently supported options are: * jump() -- causes the character to jump * onGround -- specifies whether or not the character is on the ground * gravity -- controls the "gravity" that the character physics uses for the character More options could be added (such as jump speed, step height, make fall speed, max slope, etc). --- doc/python_api/rst/bge.constraints.rst | 8 ++++++++ doc/python_api/rst/bge.types.rst | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'doc') diff --git a/doc/python_api/rst/bge.constraints.rst b/doc/python_api/rst/bge.constraints.rst index 83f2a6b4950..7757e11d41f 100644 --- a/doc/python_api/rst/bge.constraints.rst +++ b/doc/python_api/rst/bge.constraints.rst @@ -78,6 +78,14 @@ Physics Constraints (bge.constraints) :return: a vehicle constraint object. :rtype: :class:`bge.types.KX_VehicleWrapper` + +.. function:: getCharacter(gameobj) + + :arg gameobj: The game object with the character physics. + :type gameobj: :class:`bge.types.KX_GameObject` + + :return: character wrapper + :rtype: :class:`bge.types.KX_CharacterWrapper` .. function:: removeConstraint(constraintId) diff --git a/doc/python_api/rst/bge.types.rst b/doc/python_api/rst/bge.types.rst index a173137e50c..fdaeb61173f 100644 --- a/doc/python_api/rst/bge.types.rst +++ b/doc/python_api/rst/bge.types.rst @@ -3464,6 +3464,26 @@ Types :arg wheelIndex: the wheel index :type wheelIndex: integer +.. class:: KX_CharacterWrapper(PyObjectPlus) + + A wrapper to expose character physics options. + + .. attribute:: onGround + + Whether or not the character is on the ground. (read-only) + + :type: boolean + + .. attribute:: gravity + + The gravity value used for the character. + + :type: float + + .. method:: jump() + + The character jumps based on it's jump speed. + .. class:: KX_VertexProxy(SCA_IObject) A vertex holds position, UV, color and normal information. -- cgit v1.2.3