diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-06-17 17:55:59 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-06-17 17:55:59 +0400 |
commit | 9b79c57f38da9b11135ae27e56a2f5d2b8680acd (patch) | |
tree | 4547ea847201753913e0a87753aacc12a7f9af20 /source | |
parent | 19832a0639e89d2bed7856ab537c8c3b89e633c6 (diff) |
fixed Bullet bug: constraints didn't merge simulation islands.
Diffstat (limited to 'source')
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index e4e7a998ad8..f6482e2c3e7 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -687,6 +687,27 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) m_collisionWorld->UpdateActivationState(); + { + int i; + int numConstraints = m_constraints.size(); + for (i=0;i< numConstraints ; i++ ) + { + TypedConstraint* constraint = m_constraints[i]; + + const CollisionObject* colObj0 = &constraint->GetRigidBodyA(); + const CollisionObject* colObj1 = &constraint->GetRigidBodyB(); + + if (((colObj0) && ((colObj0)->mergesSimulationIslands())) && + ((colObj1) && ((colObj1)->mergesSimulationIslands()))) + { + GetDispatcher()->GetUnionFind().unite((colObj0)->m_islandTag1, + (colObj1)->m_islandTag1); + } + } + } + + m_collisionWorld->StoreIslandActivationState(); + //contacts @@ -779,7 +800,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep) #endif //USE_QUICKPROF /// solve all the contact points and contact friction - GetDispatcher()->BuildAndProcessIslands(numRigidBodies,&solverCallback); + GetDispatcher()->BuildAndProcessIslands(m_collisionWorld->GetCollisionObjectArray(),&solverCallback); #ifdef USE_QUICKPROF Profiler::endBlock("BuildAndProcessIslands"); |