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-25 05:02:13 +0300
committerErwin Coumans <blender@erwincoumans.com>2006-12-25 05:02:13 +0300
commite820cdf6a0ab757cd83ffafd0ea04d736c3faa63 (patch)
treec412336bc8dcee4fad535e46205ddffd905ac37e /extern/bullet2/src
parent0e094ffcab8ae40ce06584c02292102d53ece77d (diff)
fixing some issues: force needs to wake up objects, property sensor issue, island activation issue
Diffstat (limited to 'extern/bullet2/src')
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp49
-rw-r--r--extern/bullet2/src/LinearMath/btAlignedObjectArray.h4
2 files changed, 32 insertions, 21 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
index 3f51e9ec0a6..5a642643eed 100644
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
+++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
@@ -271,41 +271,50 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,
int islandId;
- //update the sleeping state for bodies, if all are sleeping
+ //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;
- for (endIslandIndex = startIslandIndex+1;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++)
+ 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)
+ if (!islandSleeping)
{
- int curIslandId = getIslandId(islandmanifold[startManifoldIndex]);
- if (curIslandId == islandId)
+ //find the accompanying contact manifold for this islandId
+ int numIslandManifolds = 0;
+ btPersistentManifold** startManifold = 0;
+
+ if (startManifoldIndex<numManifolds)
{
- startManifold = &islandmanifold[startManifoldIndex];
-
- for (endManifoldIndex = startManifoldIndex+1;(endManifoldIndex<numManifolds) && (islandId == getIslandId(islandmanifold[endManifoldIndex]));endManifoldIndex++)
+ 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
- numIslandManifolds = endManifoldIndex-startManifoldIndex;
- }
- }
+ }
- callback->ProcessIsland(startManifold,numIslandManifolds, islandId);
+ callback->ProcessIsland(startManifold,numIslandManifolds, islandId);
- if (numIslandManifolds)
- {
- startManifoldIndex = endManifoldIndex;
+ if (numIslandManifolds)
+ {
+ startManifoldIndex = endManifoldIndex;
+ }
}
}
}
diff --git a/extern/bullet2/src/LinearMath/btAlignedObjectArray.h b/extern/bullet2/src/LinearMath/btAlignedObjectArray.h
index 79469c03c29..3a66ebbec22 100644
--- a/extern/bullet2/src/LinearMath/btAlignedObjectArray.h
+++ b/extern/bullet2/src/LinearMath/btAlignedObjectArray.h
@@ -68,8 +68,10 @@ class btAlignedObjectArray
SIMD_FORCE_INLINE void deallocate()
{
- if(m_data)
+ if(m_data) {
m_allocator.deallocate(m_data);
+ m_data = 0;
+ }
}