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
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2006-12-12 06:08:15 +0300
committerErwin Coumans <blender@erwincoumans.com>2006-12-12 06:08:15 +0300
commit9a169f26333141b1f9e0ef4609c7ef3dba2f5835 (patch)
tree3c5ca488888a6befac6fe29e596d64115a4584ea /extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
parent237e7417e733f6942068131a612acb495a6742cf (diff)
added some new Bullet files, and upgraded to latest Bullet 2.x
Please make sure to have extern/bullet/src/LinearMath/btAlignedAllocator.cpp in your build, if you add the files by name, instead of wildcard *.cpp
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp')
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp39
1 files changed, 33 insertions, 6 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
index 33287008004..3f51e9ec0a6 100644
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
+++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
@@ -268,17 +268,44 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,
int startManifoldIndex = 0;
int endManifoldIndex = 1;
- for (startManifoldIndex=0;startManifoldIndex<numManifolds;startManifoldIndex = endManifoldIndex)
+ int islandId;
+
+
+ //update the sleeping state for bodies, if all are sleeping
+ for (int startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex)
{
- int islandId = getIslandId(islandmanifold[startManifoldIndex]);
- for (endManifoldIndex = startManifoldIndex+1;(endManifoldIndex<numManifolds) && (islandId == getIslandId(islandmanifold[endManifoldIndex]));endManifoldIndex++)
+ int islandId = getUnionFind().getElement(startIslandIndex).m_id;
+
+ for (endIslandIndex = startIslandIndex+1;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++)
+ {
+ }
+
+ //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;
+ }
+
}
- /// Process the actual simulation, only if not sleeping/deactivated
- int numIslandManifolds = endManifoldIndex-startManifoldIndex;
+
+ callback->ProcessIsland(startManifold,numIslandManifolds, islandId);
+
if (numIslandManifolds)
{
- callback->ProcessIsland(&islandmanifold[startManifoldIndex],numIslandManifolds);
+ startManifoldIndex = endManifoldIndex;
}
}
}