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
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2009-01-14 01:59:18 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2009-01-14 01:59:18 +0300
commit00c12e09066c551e3ae8ee6da3cb85fb3bcf90f8 (patch)
treea71ff54db96bf05245708ca65ad79de67c05fd76 /source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
parent7f5073729f5fafe4118edb18ac10abbab66bf0c7 (diff)
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.
Diffstat (limited to 'source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h')
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
index 74384dd8cf2..4b28d3fddfc 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
@@ -196,6 +196,8 @@ protected:
void enableCcdPhysicsController(CcdPhysicsController* ctrl);
+ void refreshCcdPhysicsController(CcdPhysicsController* ctrl);
+
btBroadphaseInterface* getBroadphase();
btDispatcher* getDispatcher();