Replace all hardcoded 1e30(f) by BT_LARGE_FLOAT, defined in btScalar.h as 1e18(f) so that its square still fits in FLT_MAX
Thanks to Ole K. for reporting! http://code.google.com/p/bullet/issues/detail?id=206
This commit is contained in:
@@ -41,7 +41,7 @@ public:
|
||||
virtual void drawCoordSystem(const btTransform& trans) {(void)trans;}
|
||||
|
||||
CastResult()
|
||||
:m_fraction(btScalar(1e30)),
|
||||
:m_fraction(btScalar(BT_LARGE_FLOAT)),
|
||||
m_debugDrawer(0),
|
||||
m_allowedPenetration(btScalar(0))
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ struct btDiscreteCollisionDetectorInterface
|
||||
struct ClosestPointInput
|
||||
{
|
||||
ClosestPointInput()
|
||||
:m_maximumDistanceSquared(btScalar(1e30)),
|
||||
:m_maximumDistanceSquared(btScalar(BT_LARGE_FLOAT)),
|
||||
m_stackAlloc(0)
|
||||
{
|
||||
}
|
||||
@@ -68,7 +68,7 @@ struct btStorageResult : public btDiscreteCollisionDetectorInterface::Result
|
||||
btVector3 m_closestPointInB;
|
||||
btScalar m_distance; //negative means penetration !
|
||||
|
||||
btStorageResult() : m_distance(btScalar(1e30))
|
||||
btStorageResult() : m_distance(btScalar(BT_LARGE_FLOAT))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s
|
||||
};
|
||||
|
||||
//just take fixed number of orientation, and sample the penetration depth in that direction
|
||||
btScalar minProj = btScalar(1e30);
|
||||
btScalar minProj = btScalar(BT_LARGE_FLOAT);
|
||||
btVector3 minNorm(btScalar(0.), btScalar(0.), btScalar(0.));
|
||||
btVector3 minA,minB;
|
||||
btVector3 seperatingAxisInA,seperatingAxisInB;
|
||||
@@ -299,7 +299,7 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s
|
||||
|
||||
input.m_transformA = displacedTrans;
|
||||
input.m_transformB = transB;
|
||||
input.m_maximumDistanceSquared = btScalar(1e30);//minProj;
|
||||
input.m_maximumDistanceSquared = btScalar(BT_LARGE_FLOAT);//minProj;
|
||||
|
||||
btIntermediateResult res;
|
||||
gjkdet.getClosestPoints(input,res,debugDraw);
|
||||
|
||||
@@ -31,7 +31,7 @@ struct btPointCollector : public btDiscreteCollisionDetectorInterface::Result
|
||||
bool m_hasResult;
|
||||
|
||||
btPointCollector ()
|
||||
: m_distance(btScalar(1e30)),m_hasResult(false)
|
||||
: m_distance(btScalar(BT_LARGE_FLOAT)),m_hasResult(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ void btVoronoiSimplexSolver::reset()
|
||||
m_cachedValidClosest = false;
|
||||
m_numVertices = 0;
|
||||
m_needsUpdate = true;
|
||||
m_lastW = btVector3(btScalar(1e30),btScalar(1e30),btScalar(1e30));
|
||||
m_lastW = btVector3(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
|
||||
m_cachedBC.reset();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user