23 #if defined(DEBUG) || defined (_DEBUG)    27 #include <spu_printf.h>    28 #define printf spu_printf    33 #define REL_ERROR2 btScalar(1.0e-6)    42 m_penetrationDepthSolver(penetrationDepthSolver),
    43 m_simplexSolver(simplexSolver),
    44 m_minkowskiA(objectA),
    45 m_minkowskiB(objectB),
    46 m_shapeTypeA(objectA->getShapeType()),
    47 m_shapeTypeB(objectB->getShapeType()),
    48 m_marginA(objectA->getMargin()),
    49 m_marginB(objectB->getMargin()),
    50 m_ignoreMargin(false),
    52 m_catchDegeneracies(1),
    53 m_fixContactNormalDirection(1)
    95         localTransA.
getOrigin() -= positionOffset;
    96         localTransB.
getOrigin() -= positionOffset;
   113         int gGjkMaxIter = 1000;
   116         bool isValid = 
false;
   117         bool checkSimplex = 
false;
   118         bool checkPenetration = 
true;
   127                 btScalar margin = marginA + marginB;
   174                         btScalar f0 = squaredDistance - delta;
   210                         btScalar previousSquaredDistance = squaredDistance;
   211                         squaredDistance = newCachedSeparatingAxis.
length2();
   213                         if (squaredDistance>previousSquaredDistance)
   217                                 squaredDistance = previousSquaredDistance;
   218                 checkSimplex = 
false;
   227                         if (previousSquaredDistance - squaredDistance <= 
SIMD_EPSILON * previousSquaredDistance) 
   241                       #if defined(DEBUG) || defined (_DEBUG)   243                               printf(
"btGjkPairDetector maxIter exceeded:%i\n",
m_curIter);   
   244                               printf(
"sepAxis=(%f,%f,%f), squaredDistance = %f, shapeTypeA=%i,shapeTypeB=%i\n",   
   292                                 distance = ((
btScalar(1.)/rlen) - margin);
   302                 bool catchDegeneratePenetrationCase = 
   306                 if (checkPenetration && (!isValid || catchDegeneratePenetrationCase ))
   322                                         localTransA,localTransB,
   330                                         btVector3 tmpNormalInB = tmpPointOnB-tmpPointOnA;
   338                                         if (lenSqr > (SIMD_EPSILON*SIMD_EPSILON))
   340                                                 tmpNormalInB /= 
btSqrt(lenSqr);
   344                                                 if (!isValid || (distance2 < distance))
   346                                                         distance = distance2;
   347                                                         pointOnA = tmpPointOnA;
   348                                                         pointOnB = tmpPointOnB;
   349                                                         normalInB = tmpNormalInB;
   367                                                                         d1 = (-normalInB).
dot(w);
   381                                                                         d0 = normalInB.
dot(w);
   414                                                 if (!isValid || (distance2 < distance))
   416                                                         distance = distance2;
   417                                                         pointOnA = tmpPointOnA;
   418                                                         pointOnB = tmpPointOnB;
   448                         pointOnB+positionOffset,
 btConvexPenetrationDepthSolver * m_penetrationDepthSolver
btVector3 m_cachedSeparatingAxis
btSimplexSolverInterface * m_simplexSolver
btGjkPairDetector(const btConvexShape *objectA, const btConvexShape *objectB, btSimplexSolverInterface *simplexSolver, btConvexPenetrationDepthSolver *penetrationDepthSolver)
btScalar length(const btQuaternion &q)
Return the length of a quaternion. 
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
btScalar m_cachedSeparatingDistance
ConvexPenetrationDepthSolver provides an interface for penetration depth calculation. 
btScalar btSqrt(btScalar y)
btVector3 localGetSupportVertexWithoutMarginNonVirtual(const btVector3 &vec) const 
btScalar dot(const btVector3 &v) const 
Return the dot product. 
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1. 
const btScalar & getZ() const 
Return the z value. 
The btConvexShape is an abstract shape interface, implemented by all convex shapes such as btBoxShape...
int gNumDeepPenetrationChecks
virtual bool calcPenDepth(btSimplexSolverInterface &simplexSolver, const btConvexShape *convexA, const btConvexShape *convexB, const btTransform &transA, const btTransform &transB, btVector3 &v, btVector3 &pa, btVector3 &pb, class btIDebugDraw *debugDraw)=0
#define btSimplexSolverInterface
int m_fixContactNormalDirection
const btScalar & getY() const 
Return the y value. 
const btScalar & getX() const 
Return the x value. 
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations...
const btConvexShape * m_minkowskiB
btVector3 can be used to represent 3D points and vectors. 
btScalar length2() const 
Return the length of the vector squared. 
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorld, btScalar depth)=0
btScalar dot(const btQuaternion &q1, const btQuaternion &q2)
Calculate the dot product between two quaternions. 
const btConvexShape * m_minkowskiA
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
virtual void getClosestPoints(const ClosestPointInput &input, Result &output, class btIDebugDraw *debugDraw, bool swapResults=false)
void getClosestPointsNonVirtual(const ClosestPointInput &input, Result &output, class btIDebugDraw *debugDraw)