Each frame, collisions are detected for rigid bodies. If two rigid bodies are deemed to be colliding with each other, we handle this collision by applying certain forces to both rigid bodies so that they are separated and no longer collide.


The separating axis theorem states that: As long as we are able to draw a line (axis) between two objects, they do not collide.

Untitled

Collision Response

In order to respond to collisions, we perform a few operations on the information we fetch from detecting collisions.

We calculate a force to apply to both points of the collision edge and the collision vertex. Here’s how: