Floating point exception in GjkPairDetector::GetClosestPoint

Post Reply
SnadderLars
Posts: 1
Joined: Fri Jun 16, 2006 3:38 am

Floating point exception in GjkPairDetector::GetClosestPoint

Post by SnadderLars »

I'm trying to run the CcdPhysicsDemo and I get a floating point exception in GjkPairDetector::GetClosestPoints, line 82 in my version of the sources:

Code: Select all

if ((delta > SimdScalar(0.0)) && (delta * delta > squaredDistance * input.m_maximumDistanceSquared))
It's caused by squaredDistance * input.m_maximumDistanceSquared where

Code: Select all

   squaredDistance = SIMD_INFINITY
   input.m_maximumDistanceSquared = 1.0E+30
the multiply results in +INF which triggers the exception.

Is this on purpose? What happens with the compare when one side is INF?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Post by Erwin Coumans »

It is an early-out test for optimization.(if the distance between two objects is larger then the maxDistance, we are not interested in results). I disabled this optimizatoin (testing) by setting the maximum to 1e30f, so it should fail the early out optimization.

I'm not using exception handling, so I didn't realize it causes troubles.
I'll fix it.
Erwin
Post Reply