diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-11-21 14:56:02 +0300 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-11-21 14:56:02 +0300 |
commit | 318b98fc9a8fe31a6b71c6e71eb0f486fd59b25a (patch) | |
tree | 914a6f2ee65b593af1b7e075ddb8cbefdd55c916 /extern/bullet2/src/BulletCollision/CollisionDispatch | |
parent | 057a6e336093c48d92e48ea1f47ea6536be291ef (diff) |
some fixes, related to object activation in game blender
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionDispatch')
3 files changed, 10 insertions, 8 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp index 9cd2828dcad..13fa0b5baa9 100644 --- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp +++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp @@ -41,9 +41,9 @@ void btCollisionObject::forceActivationState(int newState) m_activationState1 = newState; } -void btCollisionObject::activate() +void btCollisionObject::activate(bool forceActivation) { - if (!(m_collisionFlags & (CF_STATIC_OBJECT|CF_KINEMATIC_OBJECT))) + if (forceActivation || !(m_collisionFlags & (CF_STATIC_OBJECT|CF_KINEMATIC_OBJECT))) { setActivationState(ACTIVE_TAG); m_deactivationTime = 0.f; diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h index b85534c1d15..9a0129ac29c 100644 --- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h +++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h @@ -148,7 +148,7 @@ public: void forceActivationState(int newState); - void activate(); + void activate(bool forceActivation = false); inline bool isActive() const { diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp index be4f8686f30..33287008004 100644 --- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp +++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp @@ -176,7 +176,8 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher, } } } - + + if (allSleeping) { int idx; @@ -239,14 +240,15 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher, if (((colObj0) && colObj0->getActivationState() != ISLAND_SLEEPING) || ((colObj1) && colObj1->getActivationState() != ISLAND_SLEEPING)) { + //kinematic objects don't merge islands, but wake up all connected objects - if (colObj0->isKinematicObject() && colObj0->getActivationState() != ISLAND_SLEEPING) + if (colObj0->isStaticOrKinematicObject() && colObj0->getActivationState() != ISLAND_SLEEPING) { - colObj1->setActivationState(ACTIVE_TAG); + colObj1->activate(); } - if (colObj1->isKinematicObject() && colObj1->getActivationState() != ISLAND_SLEEPING) + if (colObj1->isStaticOrKinematicObject() && colObj1->getActivationState() != ISLAND_SLEEPING) { - colObj0->setActivationState(ACTIVE_TAG); + colObj0->activate(); } //filtering for response |