p2.js icon indicating copy to clipboard operation
p2.js copied to clipboard

Collision between circle and box can be missed

Open mqnc opened this issue 1 year ago • 0 comments

image

In the depicted case, the collision is missed. For each edge of the convex shape (box), the engine looks for the point on the circle that is furthest in the direction which is normal to the edge and checks whether it is inside the convex. This is not the case for any edge in the depicted scenario. It will successfully detect the collision if the circle slowly moves into the box but if the circle exceeds the back wall of the box in one step, the collision will be missed.

mqnc avatar Nov 26 '23 22:11 mqnc