fix an issue in MPR collision detection (which is not used by default), only for testing in the VoronoiFracture demo

This commit is contained in:
erwin coumans
2015-04-29 12:09:12 -07:00
parent a165ff54c9
commit 03e53627d6

View File

@@ -678,8 +678,15 @@ inline float btMprVec3PointTriDist2(const btVector3 *P,
q = btMprVec3Dot(&a, &d2); q = btMprVec3Dot(&a, &d2);
r = btMprVec3Dot(&d1, &d2); r = btMprVec3Dot(&d1, &d2);
s = (q * r - w * p) / (w * v - r * r); btScalar div = (w * v - r * r);
t = (-s * r - q) / w; if (btMprIsZero(div))
{
s=-1;
} else
{
s = (q * r - w * p) / div;
t = (-s * r - q) / w;
}
if ((btMprIsZero(s) || s > 0.f) if ((btMprIsZero(s) || s > 0.f)
&& (btMprEq(s, 1.f) || s < 1.f) && (btMprEq(s, 1.f) || s < 1.f)