diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2009-05-28 15:04:45 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2009-05-28 15:04:45 +0400 |
commit | 6ac072e1bd05d41ae0c713b9ab0c5b83477c2919 (patch) | |
tree | 7b9150de000bcba3bf6e38a5e4add8dd5f56bc5a | |
parent | b9d8a2716ae1fb85f2497352566b51b6073e038d (diff) |
BGE: no sleeping and lock axis physics options were not propagated to replicas.
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 6b904364fbe..3a3c817698b 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -700,17 +700,25 @@ void CcdPhysicsController::PostProcessReplica(class PHY_IMotionState* motionsta } } + // load some characterists that are not + btRigidBody* oldbody = GetRigidBody(); m_object = 0; CreateRigidbody(); - btRigidBody* body = GetRigidBody(); - if (body) { if (m_cci.m_mass) { body->setMassProps(m_cci.m_mass, m_cci.m_localInertiaTensor * m_cci.m_inertiaFactor); } + + if (oldbody) + { + body->setLinearFactor(oldbody->getLinearFactor()); + body->setAngularFactor(oldbody->getAngularFactor()); + if (oldbody->getActivationState() == DISABLE_DEACTIVATION) + body->setActivationState(DISABLE_DEACTIVATION); + } } // sensor object are added when needed if (!m_cci.m_bSensor) |