diff --git a/Extras/AllBulletDemosOSX/AllBulletDemos.xcodeproj/project.pbxproj b/Extras/AllBulletDemosOSX/AllBulletDemos.xcodeproj/project.pbxproj index 6915e5075..448c5c699 100644 --- a/Extras/AllBulletDemosOSX/AllBulletDemos.xcodeproj/project.pbxproj +++ b/Extras/AllBulletDemosOSX/AllBulletDemos.xcodeproj/project.pbxproj @@ -181,6 +181,7 @@ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + BCEDD8EC112AF72F00F49466 /* btSerializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEDD8EB112AF72F00F49466 /* btSerializer.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -569,6 +570,8 @@ 7AE465E40F4CA2DC007715D6 /* ForkLiftDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ForkLiftDemo.h; path = ../../Demos/ForkLiftDemo/ForkLiftDemo.h; sourceTree = SOURCE_ROOT; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* AllBulletDemos.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AllBulletDemos.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BCEDD8EA112AF72F00F49466 /* btSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = btSerializer.h; sourceTree = ""; }; + BCEDD8EB112AF72F00F49466 /* btSerializer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = btSerializer.cpp; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1075,6 +1078,8 @@ 7ACE567D0DDFA1E600CA06EA /* LinearMath */ = { isa = PBXGroup; children = ( + BCEDD8EA112AF72F00F49466 /* btSerializer.h */, + BCEDD8EB112AF72F00F49466 /* btSerializer.cpp */, 7ACE567E0DDFA1E600CA06EA /* btAabbUtil2.h */, 7ACE567F0DDFA1E600CA06EA /* btAlignedAllocator.cpp */, 7ACE56800DDFA1E600CA06EA /* btAlignedAllocator.h */, @@ -1398,6 +1403,7 @@ 7A2B5DB5105483A90069469C /* btGeneric6DofSpringConstraint.cpp in Sources */, 7A2B5DB6105483A90069469C /* btHinge2Constraint.cpp in Sources */, 7A2B5DB910548D9F0069469C /* btUniversalConstraint.cpp in Sources */, + BCEDD8EC112AF72F00F49466 /* btSerializer.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/BulletCollision/CollisionDispatch/btCollisionObject.h b/src/BulletCollision/CollisionDispatch/btCollisionObject.h index aa618b535..be3d5a710 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionObject.h +++ b/src/BulletCollision/CollisionDispatch/btCollisionObject.h @@ -119,7 +119,8 @@ public: CF_NO_CONTACT_RESPONSE = 4, CF_CUSTOM_MATERIAL_CALLBACK = 8,//this allows per-triangle material (friction/restitution) CF_CHARACTER_OBJECT = 16, - CF_DISABLE_VISUALIZE_OBJECT = 32 //disable debug drawing + CF_DISABLE_VISUALIZE_OBJECT = 32, //disable debug drawing + CF_DISABLE_SPU_COLLISION_PROCESSING = 64//disable parallel/SPU processing }; enum CollisionObjectTypes diff --git a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp index 2beb3f50f..1c9b74b7e 100644 --- a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp +++ b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp @@ -19,6 +19,7 @@ subject to the following restrictions: //collision detection #include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h" #include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h" +#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" #include "BulletCollision/CollisionShapes/btCollisionShape.h" #include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h" #include "LinearMath/btTransformUtil.h" @@ -738,7 +739,7 @@ void btDiscreteDynamicsWorld::calculateSimulationIslands() } -#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h" + class btClosestNotMeConvexResultCallback : public btCollisionWorld::ClosestConvexResultCallback { diff --git a/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp b/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp index d9c90c1ca..ee0832f12 100644 --- a/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp +++ b/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp @@ -127,7 +127,10 @@ public: { int proxyType0 = colObj0->getCollisionShape()->getShapeType(); int proxyType1 = colObj1->getCollisionShape()->getShapeType(); - if (m_dispatcher->supportsDispatchPairOnSpu(proxyType0,proxyType1)) + if (m_dispatcher->supportsDispatchPairOnSpu(proxyType0,proxyType1) + && (colObj0->getCollisionFlags() != btCollisionObject::CF_DISABLE_SPU_COLLISION_PROCESSING) + && (colObj1->getCollisionFlags() != btCollisionObject::CF_DISABLE_SPU_COLLISION_PROCESSING) + ) { int so = sizeof(SpuContactManifoldCollisionAlgorithm); #ifdef ALLOCATE_SEPARATELY diff --git a/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp b/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp index 4ca2e8757..40feb132b 100644 --- a/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp +++ b/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp @@ -870,10 +870,13 @@ void handleCollisionPair(SpuCollisionPairInput& collisionPairInput, CollisionTas for (int i = 0; i < childShapeCount0; ++i) { btCompoundShapeChild& childShape0 = lsMem.compoundShapeData[0].gSubshapes[i]; + btAssert(!btBroadphaseProxy::isCompound(childShape0.m_childShapeType)); for (int j = 0; j < childShapeCount1; ++j) { btCompoundShapeChild& childShape1 = lsMem.compoundShapeData[1].gSubshapes[j]; + btAssert(!btBroadphaseProxy::isCompound(childShape1.m_childShapeType)); + /* Create a new collision pair input struct using the two child shapes */ SpuCollisionPairInput cinput (collisionPairInput); @@ -886,9 +889,10 @@ void handleCollisionPair(SpuCollisionPairInput& collisionPairInput, CollisionTas cinput.m_shapeType1 = childShape1.m_childShapeType; cinput.m_collisionMargin1 = childShape1.m_childMargin; /* Recursively call handleCollisionPair () with new collision pair input */ + handleCollisionPair(cinput, lsMem, spuContacts, (ppu_address_t)childShape0.m_childShape, lsMem.compoundShapeData[0].gSubshapeShape[i], - (ppu_address_t)childShape1.m_childShape, lsMem.compoundShapeData[1].gSubshapeShape[j], false); // bug fix: changed index to j. + (ppu_address_t)childShape1.m_childShape, lsMem.compoundShapeData[1].gSubshapeShape[j], false); } } } @@ -910,7 +914,7 @@ void handleCollisionPair(SpuCollisionPairInput& collisionPairInput, CollisionTas for (int i = 0; i < childShapeCount; ++i) { btCompoundShapeChild& childShape = lsMem.compoundShapeData[0].gSubshapes[i]; - + btAssert(!btBroadphaseProxy::isCompound(childShape.m_childShapeType)); // Dma the child shape dmaCollisionShape (&lsMem.compoundShapeData[0].gSubshapeShape[i], (ppu_address_t)childShape.m_childShape, 1, childShape.m_childShapeType); cellDmaWaitTagStatusAll(DMA_MASK(1)); @@ -942,6 +946,7 @@ void handleCollisionPair(SpuCollisionPairInput& collisionPairInput, CollisionTas for (int i = 0; i < childShapeCount; ++i) { btCompoundShapeChild& childShape = lsMem.compoundShapeData[0].gSubshapes[i]; + btAssert(!btBroadphaseProxy::isCompound(childShape.m_childShapeType)); // Dma the child shape dmaCollisionShape (&lsMem.compoundShapeData[0].gSubshapeShape[i], (ppu_address_t)childShape.m_childShape, 1, childShape.m_childShapeType); cellDmaWaitTagStatusAll(DMA_MASK(1));