BGE bug fix: when a dynamic object is parented to a compound shape and then unparented, it jumps at the position it had before the parenting.
This commit is contained in:
@@ -533,6 +533,12 @@ void CcdPhysicsEnvironment::enableCcdPhysicsController(CcdPhysicsController* ctr
|
||||
{
|
||||
btCollisionObject* obj = ctrl->GetCollisionObject();
|
||||
obj->setUserPointer(ctrl);
|
||||
// update the position of the object from the user
|
||||
if (ctrl->GetMotionState())
|
||||
{
|
||||
btTransform xform = CcdPhysicsController::GetTransformFromMotionState(ctrl->GetMotionState());
|
||||
ctrl->SetCenterOfMassTransform(xform);
|
||||
}
|
||||
m_dynamicsWorld->addCollisionObject(obj,
|
||||
ctrl->GetCollisionFilterGroup(), ctrl->GetCollisionFilterMask());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user