bugfix for [#7006] Sleeping Objects losing Ghost Constraint
authorErwin Coumans <blender@erwincoumans.com>
Tue, 23 Sep 2008 05:00:00 +0000 (05:00 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Tue, 23 Sep 2008 05:00:00 +0000 (05:00 +0000)
Bullet logic bug in (de)activation/island management: deactivated 'fantom' objects do merge islands, in particular when connected by constraints. (fantom = object with collision detection but no collision response).

extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp

index 1cc78f76acd448a40ddb74d67c233162a216da9c..9f8e27a44076c4a2189910801da452ed77ddf994 100644 (file)
@@ -105,7 +105,7 @@ void        btSimulationIslandManager::storeIslandActivationState(btCollisionWorld* col
                for (i=0;i<colWorld->getCollisionObjectArray().size();i++)
                {
                        btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i];
-                       if (collisionObject->mergesSimulationIslands())
+                       if (!collisionObject->isStaticOrKinematicObject())
                        {
                                collisionObject->setIslandTag( m_unionFind.find(index) );
                                collisionObject->setCompanionId(-1);
index e46c4e6136b549de790308bb65659f5f9aa6928f..329a1d9cde3671b7d12400dee453b6d233719ce2 100644 (file)
@@ -688,8 +688,8 @@ void        btDiscreteDynamicsWorld::calculateSimulationIslands()
                        const btRigidBody* colObj0 = &constraint->getRigidBodyA();
                        const btRigidBody* colObj1 = &constraint->getRigidBodyB();
 
-                       if (((colObj0) && ((colObj0)->mergesSimulationIslands())) &&
-                               ((colObj1) && ((colObj1)->mergesSimulationIslands())))
+                       if (((colObj0) && (!(colObj0)->isStaticOrKinematicObject())) &&
+                               ((colObj1) && (!(colObj1)->isStaticOrKinematicObject())))
                        {
                                if (colObj0->isActive() || colObj1->isActive())
                                {