Blender Git Loki

Git Commits -> Revision 00c12e0

Revision 00c12e0 by Benoit Bolsee (master)
January 13, 2009, 22:59 (GMT)
BGE patch: dynamically update the coumpound parent shape when parenting to a compound object.

This patch modifies the way the setParent actuator and KX_GameObject::setParent() function
works when parenting to a compound object: the collision shape of the object being parented
is dynamically added to the coumpound shape.
Similarly, unparenting an object from a compound object will cause the child collision shape
to be dynamically removed from the parent shape provided that is was previously added with
setParent.

Note: * This also works if the object is parented to a child of a compound object: the
collision shape is added to the compound shape of the top parent.
* The collision shape is added with the transformation (position, scale and orientation)
it had at the time of the parenting.
* The child shape is rigidly attached to the compound shape, the transformation is not
affected by any further change in position/scale/orientation of the child object.
* While the child shape is added to the compound shape, the child object is removed from
the dynamic world to avoid superposition of shapes (one for the object itself and
one for the compound child shape). This means that collision sensors on the child
object are disabled while the child object is parent to a compound object.
* There is no difference when setParent is used on a non-compound object: the child
object is automatically changed to a static ghost object to avoid bad interaction
with the parent shape; collision sensors on the child object continue to be active
while the object is parented.
* The child shape dynamically added to a compound shape modifies the inertia of the
compound object but not the mass. It participates to collision detection as any other
"static" child shape.

Commit Details:

Full Hash: 00c12e09066c551e3ae8ee6da3cb85fb3bcf90f8
SVN Revision: 18492
Parent Commit: 7f50737
Lines Changed: +257, -15

14 Modified Paths:

/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp (+132, -3) (Diff)
/source/gameengine/Ketsji/KX_BulletPhysicsController.h (+4, -1) (Diff)
/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp (+1, -1) (Diff)
/source/gameengine/Ketsji/KX_GameObject.cpp (+23, -0) (Diff)
/source/gameengine/Ketsji/KX_IPhysicsController.cpp (+2, -1) (Diff)
/source/gameengine/Ketsji/KX_IPhysicsController.h (+9, -1) (Diff)
/source/gameengine/Ketsji/KX_OdePhysicsController.cpp (+1, -1) (Diff)
/source/gameengine/Ketsji/KX_OdePhysicsController.h (+2, -0) (Diff)
/source/gameengine/Ketsji/KX_SumoPhysicsController.h (+4, -1) (Diff)
/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp (+20, -2) (Diff)
/source/gameengine/Physics/Bullet/CcdPhysicsController.h (+42, -2) (Diff)
/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp (+13, -1) (Diff)
/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h (+2, -0) (Diff)
/source/gameengine/Physics/common/PHY_DynamicTypes.h (+2, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021