Jump to content


- - - - -

Calculating collisions in realtime - dealing with a delay in time


3 replies to this topic

#1 Xcrypt

    New Member

  • Members
  • PipPipPip
  • 144 posts
  • LocationBelgium

Posted 20 December 2011 - 12:08 AM

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

Suppose:

- 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:
http://imageshack.us...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?

#2 imerso

    Senior Member

  • Members
  • PipPipPipPip
  • 431 posts
  • LocationBrasil

Posted 20 December 2011 - 12:34 AM

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: http://www.t3hprogra...lision-tutorial

#3 jari

    New Member

  • Members
  • PipPip
  • 18 posts

Posted 20 December 2011 - 10:48 AM

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). :)

#4 Xcrypt

    New Member

  • Members
  • PipPipPip
  • 144 posts
  • LocationBelgium

Posted 20 December 2011 - 04:33 PM

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





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users