PDA

Click to See Complete Forum and Search --> : Rigid Body Collision Detection


Jacob Roman
Dec 1st, 2006, 06:52 PM
For those of you who are trying to pull off collisions between 2D convex polygons accurately at any convex shape or angle, then have I got something for you. I tried to make it as simple as possible, so figuring it out or converting to another language, or graphics library like DX/OpenGL, shouldn't be a problem.

It simply uses the Separation Axes Theorem (http://www.harveycartel.org/metanet/tutorials/tutorialA.html#section1), although most of code came from Chapter 1 of this rigid body 2D physics tutorial (which is in C++):

http://uk.geocities.com/olivier_rebellion/Polycolly.zip

It was a pain, but I converted the code into pure VB to make it easy on everyone. Enjoy the code. I too plan to write a massive rigid body physics tutorial (2D and 3D), so keep a lookout.

--------------------------------------------------------------------------

Here's another one I uploaded, only this time, the polygons cannot pass through each other thanks to collision response. I modified some of the other functions and added a couple new ones to allow this response to happen.





;)

SNIPER.PS
Dec 10th, 2009, 04:52 AM
good project