diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2009-01-14 01:59:18 +0300 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2009-01-14 01:59:18 +0300 |
commit | 00c12e09066c551e3ae8ee6da3cb85fb3bcf90f8 (patch) | |
tree | a71ff54db96bf05245708ca65ad79de67c05fd76 /source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp | |
parent | 7f5073729f5fafe4118edb18ac10abbab66bf0c7 (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/Ketsji/KX_SCA_DynamicActuator.cpp')
0 files changed, 0 insertions, 0 deletions