Add missing files to XCode project

Add option to disable SPU collision processing, and add assert to detect unsupported recursive compounds on SPU.
This commit is contained in:
erwin.coumans
2010-02-17 02:34:26 +00:00
parent 729a883b71
commit 45e7c7f564
5 changed files with 21 additions and 5 deletions

View File

@@ -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 = "<group>"; };
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 = "<group>"; };
BCEDD8EB112AF72F00F49466 /* btSerializer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = btSerializer.cpp; sourceTree = "<group>"; };
/* 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;
};

View File

@@ -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

View File

@@ -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
{

View File

@@ -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

View File

@@ -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));