Blender Git Loki
Git Commits -> Revision dd65a44
Revision dd65a44 by Sybren A. Stüvel (master) February 8, 2015, 14:52 (GMT) |
BGE physics: When colliding, report first contact point to Python This patch adds two parameters to the functions in the collisionCallbacks list. The callback function should thus be like this: ``` def on_colliding(other, point, normal): print("Colliding with %s at %s with normal %s" % (other, point, normal)) game_ob.collisionCallbacks.append(on_colliding) ``` The `point` parameter will contain the collision point in world coordinates on the current object, and the `normal` contains the surface normal at the collision point. The callback functions are checked for the number of arguments `co_argcount`. The new `point` and `normal` arguments are only passed when `co_argcount > 1` or when `co_argcount` cannot be determined. Reviewers: brita_, campbellbarton Subscribers: sergey, sybren, agoose77 Projects: #game_physics Differential Revision: https://developer.blender.org/D926 |
Commit Details:
Full Hash: dd65a44c9a192d62f7661090682ee0dc99fb0491
Parent Commit: 51b645a
Lines Changed: +143, -12
6 Modified Paths:
/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst (+39, -2) (Diff)
/source/gameengine/Ketsji/KX_GameObject.cpp (+42, -4) (Diff)
/source/gameengine/Ketsji/KX_GameObject.h (+1, -1) (Diff)
/source/gameengine/Ketsji/KX_TouchEventManager.cpp (+21, -3) (Diff)
/source/gameengine/Ketsji/KX_TouchEventManager.h (+23, -1) (Diff)
/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp (+17, -1) (Diff)
/source/gameengine/Ketsji/KX_GameObject.cpp (+42, -4) (Diff)
/source/gameengine/Ketsji/KX_GameObject.h (+1, -1) (Diff)
/source/gameengine/Ketsji/KX_TouchEventManager.cpp (+21, -3) (Diff)
/source/gameengine/Ketsji/KX_TouchEventManager.h (+23, -1) (Diff)
/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp (+17, -1) (Diff)