Calculating collisions in realtime - dealing with a delay in time

Xcrypt 101 Dec 20, 2011 at 00:08

This question has been spooking around in my head for way too long…


  • You’re coding a program in which 10 circles move around on the screen in realtime, all with a different velocity, that can change at certain times due to physics-calculations.
  • The calculations can only be calculated on every frame
  • Each frame, you have to make sure the circles who “collide”/”have collided during the time between this frame and the last” with eachother will ‘bounce off’ by using physics-calculations
  • During the time between frame x and frame x+1, three circles will collide with eachother. However, during frame x none of the circles touches the other. In frame x+1, the same thing applies (none collides) I will try to better illustrate this with an image with my epic paint skills:…ionproblem.jpg/

The question:

What are good ways to keep track of collision like this, so that a collision wouldn’t get skipped due to some (unexpected) large delay in time between two frames?

3 Replies

Please log in or register to post a reply.

vrnunes 102 Dec 20, 2011 at 00:34

This is a well known problem with some good solutions, like Swept Circles for 2D and Swept Spheres for 3D collision detection and response.

Example tutorial:

jari 101 Dec 20, 2011 at 10:48

As said above, it is a common problem named: “tunneling”, “bullet through paper”. Maybe these names gives you help finding the solution (google these, a lots of examples, tutorials for solving this). :)

Xcrypt 101 Dec 20, 2011 at 16:33

Btw, I didn’t mean to restrict the question to circles, was just to give a simple example.