BGE bug fix: dynamically added sensor objects didn't have their physic shape synchronized with movement.

This commit is contained in:
Benoit Bolsee 2009-06-01 09:44:41 +00:00
parent d1f7a2ceee
commit 358ec00256
2 changed files with 8 additions and 9 deletions

@ -92,7 +92,13 @@ void KX_BulletPhysicsController::SetObject (SG_IObject* object)
gameobj->SetPhysicsController(this,gameobj->IsDynamic());
CcdPhysicsController::setNewClientInfo(gameobj->getClientInfo());
if (m_bSensor)
{
// use a different callback function for sensor object,
// bullet will not synchronize, we must do it explicitely
SG_Callbacks& callbacks = gameobj->GetSGNode()->GetCallBackFunctions();
callbacks.m_updatefunc = KX_GameObject::SynchronizeTransformFunc;
}
}
MT_Scalar KX_BulletPhysicsController::GetRadius()

@ -1115,15 +1115,8 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
shapeInfo->Release();
gameobj->SetPhysicsController(physicscontroller,isbulletdyna);
if (isbulletsensor)
{
// use a different callback function for sensor object,
// bullet will not synchronize, we must do it explicitely
SG_Callbacks& callbacks = gameobj->GetSGNode()->GetCallBackFunctions();
callbacks.m_updatefunc = KX_GameObject::SynchronizeTransformFunc;
}
// don't add automatically sensor object, they are added when a collision sensor is registered
else if (objprop->m_in_active_layer)
if (!isbulletsensor && objprop->m_in_active_layer)
{
env->addCcdPhysicsController( physicscontroller);
}