|
@@ -551,7 +551,7 @@ public:
|
|
#ifdef JPH_GJK_DEBUG
|
|
#ifdef JPH_GJK_DEBUG
|
|
Trace("v . r = %g", (double)v_dot_r);
|
|
Trace("v . r = %g", (double)v_dot_r);
|
|
#endif
|
|
#endif
|
|
- if (v_dot_r >= 0.0f)
|
|
|
|
|
|
+ if (v_dot_r >= -1.0e-18f) // Instead of checking >= 0, check with epsilon as we don't want the division below to overflow to infinity as it can cause a float exception
|
|
return false;
|
|
return false;
|
|
|
|
|
|
// Update the lower bound for lambda
|
|
// Update the lower bound for lambda
|
|
@@ -744,7 +744,7 @@ public:
|
|
#ifdef JPH_GJK_DEBUG
|
|
#ifdef JPH_GJK_DEBUG
|
|
Trace("v . r = %g", (double)v_dot_r);
|
|
Trace("v . r = %g", (double)v_dot_r);
|
|
#endif
|
|
#endif
|
|
- if (v_dot_r >= 0.0f)
|
|
|
|
|
|
+ if (v_dot_r >= -1.0e-18f) // Instead of checking >= 0, check with epsilon as we don't want the division below to overflow to infinity as it can cause a float exception
|
|
return false;
|
|
return false;
|
|
|
|
|
|
// Update the lower bound for lambda
|
|
// Update the lower bound for lambda
|