apply patch for body suspend/resume
authorErwin Coumans <blender@erwincoumans.com>
Tue, 29 Mar 2011 15:46:02 +0000 (15:46 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Tue, 29 Mar 2011 15:46:02 +0000 (15:46 +0000)
See also issue #26614
http://projects.blender.org/tracker/index.php?func=detail&aid=26614&group_id=9&atid=306

source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp

index f28ce953d0b8fe1d2a65b44b9492d99e24bec826..c87157ee993b5a99e7dd72d9e80274c9e333a751 100644 (file)
@@ -470,8 +470,12 @@ void       CcdPhysicsEnvironment::updateCcdPhysicsController(CcdPhysicsController* ctr
                        if (newMass)
                                body->getCollisionShape()->calculateLocalInertia(newMass, inertia);
                        body->setMassProps(newMass, inertia);
+                       m_dynamicsWorld->addRigidBody(body, newCollisionGroup, newCollisionMask);
+               }       
+               else
+               {
+                       m_dynamicsWorld->addCollisionObject(obj, newCollisionGroup, newCollisionMask);
                }
-               m_dynamicsWorld->addCollisionObject(obj, newCollisionGroup, newCollisionMask);
        }
        // to avoid nasty interaction, we must update the property of the controller as well
        ctrl->m_cci.m_mass = newMass;