Fix for [#32185] "Incorrect physics for LibLoaded dupligroups" reported by Daniel...
authorMitchell Stokes <mogurijin@gmail.com>
Thu, 26 Jul 2012 09:35:52 +0000 (09:35 +0000)
committerMitchell Stokes <mogurijin@gmail.com>
Thu, 26 Jul 2012 09:35:52 +0000 (09:35 +0000)
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp

index 0a105ee1c1adf3201b245f01e46bf02b076c9cb0..497a337ac19e3cd12e9baa1cb2aa990ebca3dc01 100644 (file)
@@ -836,6 +836,11 @@ void       CcdPhysicsController::SetPhysicsEnvironment(class PHY_IPhysicsEnvironment *
                if (m_cci.m_physicsEnv->removeCcdPhysicsController(this))
                {
                        physicsEnv->addCcdPhysicsController(this);
+
+                       // Set the object to be active so it can at least by evaluated once.
+                       // This fixes issues with static objects not having their physics meshes
+                       // in the right spot when lib loading.
+                       this->GetCollisionObject()->setActivationState(ACTIVE_TAG);
                }
                m_cci.m_physicsEnv = physicsEnv;
        }