diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-12-25 22:54:17 +0300 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-12-25 22:54:17 +0300 |
commit | 11cd11d4c938afefb0ec435f14fd02e0213f6b1e (patch) | |
tree | 569836ce9b46647f873315962951ca9dc3ea9186 /extern/bullet2 | |
parent | 6b64ccdca13431e6ac31d21707e98aba26431ecc (diff) |
minor fix in Bullet internals
Diffstat (limited to 'extern/bullet2')
-rw-r--r-- | extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp | 93 |
1 files changed, 48 insertions, 45 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp index 5a642643eed..06a5f95143e 100644 --- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp +++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp @@ -271,50 +271,53 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher, int islandId; - //solve the constraint for each islands, if there are contacts/constraints - for (int startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex) - { - int islandId = getUnionFind().getElement(startIslandIndex).m_id; - - bool islandSleeping = false; - - for (endIslandIndex = startIslandIndex;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++) - { - int i = getUnionFind().getElement(endIslandIndex).m_sz; - btCollisionObject* colObj0 = collisionObjects[i]; - if (!colObj0->isActive()) - islandSleeping = true; - } - - if (!islandSleeping) - { - //find the accompanying contact manifold for this islandId - int numIslandManifolds = 0; - btPersistentManifold** startManifold = 0; - - if (startManifoldIndex<numManifolds) - { - int curIslandId = getIslandId(islandmanifold[startManifoldIndex]); - if (curIslandId == islandId) - { - startManifold = &islandmanifold[startManifoldIndex]; - - for (endManifoldIndex = startManifoldIndex+1;(endManifoldIndex<numManifolds) && (islandId == getIslandId(islandmanifold[endManifoldIndex]));endManifoldIndex++) - { - - } - /// Process the actual simulation, only if not sleeping/deactivated - numIslandManifolds = endManifoldIndex-startManifoldIndex; - } - - } - - callback->ProcessIsland(startManifold,numIslandManifolds, islandId); + //traverse the simulation islands, and call the solver, unless all objects are sleeping/deactivated + for (int startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex) + { + int islandId = getUnionFind().getElement(startIslandIndex).m_id; + + + bool islandSleeping = false; + + for (endIslandIndex = startIslandIndex;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++) + { + int i = getUnionFind().getElement(endIslandIndex).m_sz; + btCollisionObject* colObj0 = collisionObjects[i]; + if (!colObj0->isActive()) + islandSleeping = true; + } + + + //find the accompanying contact manifold for this islandId + int numIslandManifolds = 0; + btPersistentManifold** startManifold = 0; + + if (startManifoldIndex<numManifolds) + { + int curIslandId = getIslandId(islandmanifold[startManifoldIndex]); + if (curIslandId == islandId) + { + startManifold = &islandmanifold[startManifoldIndex]; + + for (endManifoldIndex = startManifoldIndex+1;(endManifoldIndex<numManifolds) && (islandId == getIslandId(islandmanifold[endManifoldIndex]));endManifoldIndex++) + { + + } + /// Process the actual simulation, only if not sleeping/deactivated + numIslandManifolds = endManifoldIndex-startManifoldIndex; + } + + } + + if (!islandSleeping) + { + callback->ProcessIsland(startManifold,numIslandManifolds, islandId); + } + + if (numIslandManifolds) + { + startManifoldIndex = endManifoldIndex; + } + } - if (numIslandManifolds) - { - startManifoldIndex = endManifoldIndex; - } - } - } } |