1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How do collision algorithms work (like Angry birds)?

  1. Oct 9, 2011 #1
    Does anyone know how to write an algorithm for collisions between many objects? An example like this would be the game Angry Birds which uses the Chipmunk physics engine? Chipmunk is based of "contact persistence algorithm" but I can't find out really what that is... any ideas on how to program it?
  2. jcsd
  3. Oct 11, 2011 #2
    Well, I can't say too much about it, but I can give some ideas. It probably involves the laws of physics and the equations that result from them. Things like ballistic projectiles typically covered in a high school physics class and work/energy. You could probably make a very basic physics engine based only on physics learned in high school, but it would not be optimal and particularly realistic, being based on assumptions that there is no air resistance, averages, and other reasonable assumptions that work in theory but produce small errors in real life.
  4. Oct 11, 2011 #3


    User Avatar
    Homework Helper

    I've seen several approaches for collision detection. The simplest ones seem to wait until portions of two (or more) objects occupy the same space. Then the previous velocities and positions of the objects (each integration step saves one set of values for this purpose), are used to calculate the reaction to the collision. This can get complicated if more than two objects can collide at the same time.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook