diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2009-06-01 13:44:41 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2009-06-01 13:44:41 +0400 |
commit | 358ec00256bd91f29e14620f1c898f7e9e8e8305 (patch) | |
tree | 0887a3c65a4cc0947d014021ad85e5a64835dc75 /source | |
parent | d1f7a2ceeeb711118d6172a3495f42a4a02718fc (diff) |
BGE bug fix: dynamically added sensor objects didn't have their physic shape synchronized with movement.
Diffstat (limited to 'source')
-rw-r--r-- | source/gameengine/Ketsji/KX_BulletPhysicsController.cpp | 8 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index e22edfd1306..748b0667061 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -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() diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 297b15a2b78..51c41c0686d 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -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); } |