p2.js
p2.js copied to clipboard
Collision between circle and box can be missed
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.