From 659207e7a39dfb8b69cfa1d5d5f740537168db41 Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Sat, 7 Oct 2006 02:18:05 +0000 Subject: [PATCH] removed some obsolete/debugging stuff --- .../btDiscreteCollisionDetectorInterface.h | 4 +-- .../btGjkPairDetector.cpp | 27 ++++++------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h b/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h index 3f675f23e..8889699b3 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h +++ b/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h @@ -27,8 +27,7 @@ subject to the following restrictions: /// by taking closestPointInA = closestPointInB + m_distance * m_normalOnSurfaceB struct btDiscreteCollisionDetectorInterface { - void operator delete(void* ptr) {}; - + struct Result { void operator delete(void* ptr) {}; @@ -60,7 +59,6 @@ struct btDiscreteCollisionDetectorInterface // virtual void getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw) = 0; - btScalar getCollisionMargin() { return 0.2f;} }; struct btStorageResult : public btDiscreteCollisionDetectorInterface::Result diff --git a/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp b/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp index 75b1c9809..f6fdd6435 100644 --- a/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp +++ b/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp @@ -26,8 +26,9 @@ static const btScalar rel_error = btScalar(1.0e-5); btScalar rel_error2 = rel_error * rel_error; float maxdist2 = 1.e30f; - -int gGjkMaxIter=1000; +#ifdef __SPU__ +#include +#endif //__SPU__ btGjkPairDetector::btGjkPairDetector(btConvexShape* objectA,btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver) :m_cachedSeparatingAxis(0.f,0.f,1.f), @@ -77,22 +78,6 @@ int curIter = 0; while (true) { - //degeneracy, this is typically due to invalid/uninitialized worldtransforms for a btCollisionObject - if (curIter++ > gGjkMaxIter) - { - #if defined(DEBUG) || defined (_DEBUG) - printf("btGjkPairDetector maxIter exceeded:%i\n",curIter); - printf("sepAxis=(%f,%f,%f), squaredDistance = %f, shapeTypeA=%i,shapeTypeB=%i\n", - m_cachedSeparatingAxis.getX(), - m_cachedSeparatingAxis.getY(), - m_cachedSeparatingAxis.getZ(), - squaredDistance, - m_minkowskiA->getShapeType(), - m_minkowskiB->getShapeType()); - #endif - break; - - } btVector3 seperatingAxisInA = (-m_cachedSeparatingAxis)* input.m_transformA.getBasis(); btVector3 seperatingAxisInB = m_cachedSeparatingAxis* input.m_transformB.getBasis(); @@ -211,6 +196,10 @@ int curIter = 0; if (isValid) { +#ifdef __SPU__ + //spu_printf("distance\n"); +#endif //__CELLOS_LV2__ + output.setShapeIdentifiers(m_partId0,m_index0,m_partId1,m_index1); output.addContactPoint( @@ -218,7 +207,7 @@ int curIter = 0; pointOnB, distance); //printf("gjk add:%f",distance); - } + } }