# How do collision algorithms work (like Angry birds)?

1. Oct 9, 2011

### xael821

Hi,
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. Oct 11, 2011

### MrNerd

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.

3. Oct 11, 2011

### rcgldr

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.