Bullet contact point response have zero distance (SOLVED)

In 3d physics.Sometimes i get contact_point_response with zero distance. :thinking:
DEBUG:SCRIPT: distance:0 normal[0.997627, 0.068845, 0.000000]
DEBUG:SCRIPT: distance:0 normal[1.000000, 0.000000, 0.000000]
DEBUG:SCRIPT: distance:0 normal[0.857927, 0.513771, 0.000000]
DEBUG:SCRIPT: distance:0 normal[0.000000, 1.000000, 0.000000]
DEBUG:SCRIPT: distance:0 normal[0.000000, 1.000000, 0.000000]

The contact_point_response distance is a non-negative number, zero meaning exactly touching.
Is there a problem? Does the physics not work as expected?

2 Likes

No it is not problem. It break my logic, but i add check that distance not equal 0 and all work,as i need. For me It sounds strange that distance can be zero.

2 Likes

You mean that it’s unlikely that it’s exactly zero?
Sure, floating point precision might have that they are not exactly zero distance, but for the sake of the physics engine, it is within the contact threshold, and when that happens, the dynamic object could go to rest, and it seems like a good thing to return distance=0 then. Not entirely sure this is the case here though :slight_smile:

3 Likes