more solver experiments, randomize the order of contact points, not just manifolds

use #defines for constants, rather then const btScalar
This commit is contained in:
ejcoumans
2006-11-04 05:22:36 +00:00
parent c4c4523a4e
commit 23c64fb0db
11 changed files with 71 additions and 51 deletions

View File

@@ -42,7 +42,8 @@ struct btDispatcherInfo
m_timeOfImpact(1.f),
m_useContinuous(false),
m_debugDraw(0),
m_enableSatConvex(false)
m_enableSatConvex(false),
m_enableSPU(false)
{
}
@@ -53,6 +54,7 @@ struct btDispatcherInfo
bool m_useContinuous;
class btIDebugDraw* m_debugDraw;
bool m_enableSatConvex;
bool m_enableSPU;
};

View File

@@ -14,6 +14,7 @@ subject to the following restrictions:
*/
#include "btCollisionDispatcher.h"
@@ -34,8 +35,8 @@ int gNumManifold = 0;
btCollisionDispatcher::btCollisionDispatcher(bool noDefaultAlgorithms)
:m_useIslands(true),
m_count(0),
m_convexConvexCreateFunc(0),
m_count(0),
m_convexConcaveCreateFunc(0),
m_swappedConvexConcaveCreateFunc(0),
m_compoundCreateFunc(0),
@@ -54,7 +55,7 @@ m_emptyCreateFunc(0)
}
}
btCollisionDispatcher::btCollisionDispatcher ():
m_useIslands(true),
m_count(0)

View File

@@ -40,6 +40,7 @@ m_ownsBroadphasePairCache(false)
{
}
btCollisionWorld::btCollisionWorld()
: m_dispatcher1(new btCollisionDispatcher()),
m_broadphasePairCache(new btSimpleBroadphase()),

View File

@@ -22,9 +22,9 @@ subject to the following restrictions:
#include <stdio.h> //for debug printf
#endif
static const btScalar rel_error = btScalar(1.0e-5);
btScalar rel_error2 = rel_error * rel_error;
float maxdist2 = 1.e30f;
#define REL_ERROR2 1.0e-10f
#ifdef __SPU__
#include <spu_printf.h>
@@ -102,7 +102,7 @@ void btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result&
break;
}
// are we getting any closer ?
if (squaredDistance - delta <= squaredDistance * rel_error2)
if (squaredDistance - delta <= squaredDistance * REL_ERROR2)
{
checkSimplex = true;
break;
@@ -172,6 +172,7 @@ void btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result&
float rlen = 1.f / btSqrt(lenSqr );
normalInB *= rlen; //normalize
btScalar s = btSqrt(squaredDistance);
ASSERT(s > btScalar(0.0));
pointOnA -= m_cachedSeparatingAxis * (marginA / s);
pointOnB += m_cachedSeparatingAxis * (marginB / s);