diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-12-06 02:13:23 +0300 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-12-06 02:13:23 +0300 |
commit | 2746034295cdaad49c56463afb481cad45ce1415 (patch) | |
tree | 52c76285ec574af2ee4cadb8dd2005af4776a089 /source/gameengine/Ketsji | |
parent | 149d231d69b3cd66bca3efd809ad8ce07a6aebf5 (diff) |
BGE bug #17731 fixed: No sleeping Button disables dynamics of an object if it's parented+unparented
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_BulletPhysicsController.cpp | 5 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_BulletPhysicsController.h | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index bf838e60210..3a20bbfbb11 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -185,7 +185,8 @@ void KX_BulletPhysicsController::SuspendDynamics(bool ghost) m_savedMass = GetMass(); m_savedCollisionFilterGroup = handle->m_collisionFilterGroup; m_savedCollisionFilterMask = handle->m_collisionFilterMask; - body->setActivationState(DISABLE_SIMULATION); + m_savedActivationState = body->getActivationState(); + body->forceActivationState(DISABLE_SIMULATION); GetPhysicsEnvironment()->updateCcdPhysicsController(this, 0.0, btCollisionObject::CF_STATIC_OBJECT|((ghost)?btCollisionObject::CF_NO_CONTACT_RESPONSE:(m_savedCollisionFlags&btCollisionObject::CF_NO_CONTACT_RESPONSE)), @@ -204,7 +205,7 @@ void KX_BulletPhysicsController::RestoreDynamics() m_savedCollisionFlags, m_savedCollisionFilterGroup, m_savedCollisionFilterMask); - GetRigidBody()->forceActivationState(ACTIVE_TAG); + GetRigidBody()->forceActivationState(m_savedActivationState); } } diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h index cdcb82c87ca..d5fca4ec6d3 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h @@ -9,6 +9,7 @@ class KX_BulletPhysicsController : public KX_IPhysicsController ,public CcdPhysi { private: int m_savedCollisionFlags; + int m_savedActivationState; short int m_savedCollisionFilterGroup; short int m_savedCollisionFilterMask; MT_Scalar m_savedMass; |