simple collision detection in 2d

fork
Posts: 14
Joined: Wed Aug 03, 2005 3:47 pm

simple collision detection in 2d

Post by fork »

What advice can you people give me for simple collision detection in 2d? For example, say I use bisection to find a time that was very close to the collision. So now I have two polygons that are almost touching. How can I generate the contact set from this? I am looking for the simplest thing possible. Speed is not an issue.
Erin Catto
Posts: 316
Joined: Fri Jul 01, 2005 5:29 am
Location: Irvine

Post by Erin Catto »

If you intend to allow overlap (which I recommend), then the separating axis test can work well. This might help you:
http://www.gphysics.com/files/GDC2006_ErinCatto.zip
fork
Posts: 14
Joined: Wed Aug 03, 2005 3:47 pm

Post by fork »

the nonoverlapping condition is necessary to use LCP.
Erin Catto
Posts: 316
Joined: Fri Jul 01, 2005 5:29 am
Location: Irvine

Post by Erin Catto »

If you use Baumgarte stabilization, it is quite easy to allow for overlap in an LCP formulation. I do not know of a successful physics engine that has completely eliminated overlap.