Page 1 of 1

What is "contacts->dist==0" mean? When will it happen

Posted: Thu Nov 05, 2009 9:37 pm
by mizyeh
I noticed that in collision callback function sometimes "contacts->dist==0" ,
I know dist is how far the two objects are penetrating eachother,but it seems nonzero value mostly .
"contacts->dist==0" seems to happen when objectA colliding objectB very slightly,
In order to using this characteristic , I'd like to know what is it mean and when will it happen, thanks :D
Miz

Re: What is "contacts->dist==0" mean? When will it happen

Posted: Fri Nov 06, 2009 9:34 am
by slembcke
That should be extremely rare when using imprecise floating point numbers. It basically means that the objects are touching, but not overlapping. That probably happens from setting initial positions on objects, like creating two circles with radius 1 exactly two distance units apart.