Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJorge Bernal <jbernalmartinez@gmail.com>2014-07-07 19:01:49 +0400
committerMitchell Stokes <mogurijin@gmail.com>2014-07-07 19:06:39 +0400
commit1f43b083a97ee56b8b15692ef19d0e973b6d31ac (patch)
tree358346e602ab4be4ca8b1f650955d23b60c9e742 /doc
parentef22e972b1ad0bed1a79587b72d50c7da4c6b4e8 (diff)
BGE: Fix for applyImpulse function
This is related to task T29419. Credit also goes to Goran Milovanovic (goran) for proposing an initial fix for this issue. The issue is the current behavior of applyImpulse doesn't match the behavior described in the documentation as instead of a impulse point in world coordinates, it seems to require a coordinate in a local space. Additionally, applyImpulse function isn't consistent with similar functions (applyForce, applyTorque, etc) as it doesn't allow to choose in which space (local or global) the impulse is applied. Now, we have the following function: applyImpulse(point, impulse, local=False) being "point" the point to apply the impulse to (in world or local coordinates). When local is False will have both point and impulse in World space and when local is True will have point and impulse in local space. Reviewers: moguri, dfelinto, brita_ Reviewed By: moguri Differential Revision: https://developer.blender.org/D567
Diffstat (limited to 'doc')
-rw-r--r--doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst12
1 files changed, 9 insertions, 3 deletions
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
index b314a47c8e9..215ff40577c 100644
--- a/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
+++ b/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
@@ -551,7 +551,7 @@ base class --- :class:`SCA_IObject`
This is not implimented at the moment.
- .. method:: applyImpulse(point, impulse)
+ .. method:: applyImpulse(point, impulse, local=False)
Applies an impulse to the game object.
@@ -559,8 +559,14 @@ base class --- :class:`SCA_IObject`
If point != position, applyImpulse will also change the object's angular momentum.
Otherwise, only linear momentum will change.
- :arg point: the point to apply the impulse to (in world coordinates)
- :type point: the point to apply the impulse to (in world coordinates)
+ :arg point: the point to apply the impulse to (in world or local coordinates)
+ :type point: point [ix, iy, iz] the point to apply the impulse to (in world or local coordinates)
+ :arg impulse: impulse vector.
+ :type impulse: 3D Vector
+ :arg local:
+ * False: you get the "global" impulse ie: relative to world coordinates with world orientation.
+ * True: you get the "local" impulse ie: relative to local coordinates with object orientation.
+ :type local: boolean
.. method:: suspendDynamics()