Sign in to follow this  
shadowisadog

Rigid body collisions?

Recommended Posts

Hello everyone :). I have been working on a rigid body system using verlet integration, but I am having trouble getting the collision detection to work :(. I understand the verlet integration and the constraint code, but after reading up on SAT and related methods I am totally lost. Could someone help explain how to use the SAT theory (preferably with examples that aren't in flash...) with N sided polygons? My engine currently doesn't understand the concept of object's as related to a collection of bones and points so I suppose I need to add this in order to be able to get a CM. Just some help getting started in general would be great! Thanks :). PS here is my verlet engine: Verlet Engine (It was written in the popcap framework and uses an xml file to define the point nodes :)).

Share this post


Link to post
Share on other sites
Your first stop should probably be Oli's SAT tutorials, available here:

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

Full explanations and c++ source code. You will probably also want to google for an explanation of Vectors, Matrices, dot product (especially how it relates to projecting vectors on each other), and the difference between norm, normalize, and normal (that tripped me up for a while), if you're not familiar with those terms already.

Doing an advanced google search on SAT with gamedev.net in the domain field will also turn up a lot of info. If you're still unsure on anything, just ask.

p.s. Nice demo. How long did that take you?

Share this post


Link to post
Share on other sites
Quote:

Full explanations and c++ source code. You will probably also want to google for an explanation of Vectors, Matrices, dot product (especially how it relates to projecting vectors on each other), and the difference between norm, normalize, and normal (that tripped me up for a while), if you're not familiar with those terms already.


I know thoose well, thanks :).

Quote:
p.s. Nice demo. How long did that take you?


A few hours but it was my third implementation. I wrote the first one in SDL using DevCPP at school and then I rewrote it using SDL with visual c++ 6.0 at home. Then I wasn't happy with that one either so I rewrote it again using the popcap framework.

The first version was very simplistic and didn't even follow the hitman tutorial. I just used some verlet constraint code I found off of a wiki. I then wasn't happy with this version becuase it lacked drawing lines between the points and various masses, ect.

The second version I wrote to improve the first and it was OK. Then I learned that I didn't actually have verlet integration in there at all! So after reading the hitman tutorial, I finally wrote the third version which uses xml and real verlet integration. Also the first two versions didn't use vectors but vector components so I rewrote the third to use a 2d vector class that I wrote :).

Quote:

Your first stop should probably be Oli's SAT tutorials, available here:

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

I will check out thoose code samples, thanks!

Quote:
Try looking at this discussion ... maybe it can also help you a little


I had already read that in the past but without code or math it wasn't extremely helpful to me. Thanks for helping anyway though :).


Thanks alot everyone, I will try it all out and post again soon :D.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this