Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/extern
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2006-12-25 22:54:17 +0300
committerErwin Coumans <blender@erwincoumans.com>2006-12-25 22:54:17 +0300
commit11cd11d4c938afefb0ec435f14fd02e0213f6b1e (patch)
tree569836ce9b46647f873315962951ca9dc3ea9186 /extern
parent6b64ccdca13431e6ac31d21707e98aba26431ecc (diff)
minor fix in Bullet internals
Diffstat (limited to 'extern')
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp93
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;
- }
- }
- }
}