mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-15 14:10:11 +00:00
removed some obsolete/debugging stuff
This commit is contained in:
parent
04e5e70d31
commit
659207e7a3
@ -27,8 +27,7 @@ subject to the following restrictions:
|
|||||||
/// by taking closestPointInA = closestPointInB + m_distance * m_normalOnSurfaceB
|
/// by taking closestPointInA = closestPointInB + m_distance * m_normalOnSurfaceB
|
||||||
struct btDiscreteCollisionDetectorInterface
|
struct btDiscreteCollisionDetectorInterface
|
||||||
{
|
{
|
||||||
void operator delete(void* ptr) {};
|
|
||||||
|
|
||||||
struct Result
|
struct Result
|
||||||
{
|
{
|
||||||
void operator delete(void* ptr) {};
|
void operator delete(void* ptr) {};
|
||||||
@ -60,7 +59,6 @@ struct btDiscreteCollisionDetectorInterface
|
|||||||
//
|
//
|
||||||
virtual void getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw) = 0;
|
virtual void getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw) = 0;
|
||||||
|
|
||||||
btScalar getCollisionMargin() { return 0.2f;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct btStorageResult : public btDiscreteCollisionDetectorInterface::Result
|
struct btStorageResult : public btDiscreteCollisionDetectorInterface::Result
|
||||||
|
@ -26,8 +26,9 @@ static const btScalar rel_error = btScalar(1.0e-5);
|
|||||||
btScalar rel_error2 = rel_error * rel_error;
|
btScalar rel_error2 = rel_error * rel_error;
|
||||||
float maxdist2 = 1.e30f;
|
float maxdist2 = 1.e30f;
|
||||||
|
|
||||||
|
#ifdef __SPU__
|
||||||
int gGjkMaxIter=1000;
|
#include <spu_printf.h>
|
||||||
|
#endif //__SPU__
|
||||||
|
|
||||||
btGjkPairDetector::btGjkPairDetector(btConvexShape* objectA,btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver)
|
btGjkPairDetector::btGjkPairDetector(btConvexShape* objectA,btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver)
|
||||||
:m_cachedSeparatingAxis(0.f,0.f,1.f),
|
:m_cachedSeparatingAxis(0.f,0.f,1.f),
|
||||||
@ -77,22 +78,6 @@ int curIter = 0;
|
|||||||
|
|
||||||
while (true)
|
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 seperatingAxisInA = (-m_cachedSeparatingAxis)* input.m_transformA.getBasis();
|
||||||
btVector3 seperatingAxisInB = m_cachedSeparatingAxis* input.m_transformB.getBasis();
|
btVector3 seperatingAxisInB = m_cachedSeparatingAxis* input.m_transformB.getBasis();
|
||||||
@ -211,6 +196,10 @@ int curIter = 0;
|
|||||||
|
|
||||||
if (isValid)
|
if (isValid)
|
||||||
{
|
{
|
||||||
|
#ifdef __SPU__
|
||||||
|
//spu_printf("distance\n");
|
||||||
|
#endif //__CELLOS_LV2__
|
||||||
|
|
||||||
output.setShapeIdentifiers(m_partId0,m_index0,m_partId1,m_index1);
|
output.setShapeIdentifiers(m_partId0,m_index0,m_partId1,m_index1);
|
||||||
|
|
||||||
output.addContactPoint(
|
output.addContactPoint(
|
||||||
@ -218,7 +207,7 @@ int curIter = 0;
|
|||||||
pointOnB,
|
pointOnB,
|
||||||
distance);
|
distance);
|
||||||
//printf("gjk add:%f",distance);
|
//printf("gjk add:%f",distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user