Rigid body dynamics intro

Started by
6 comments, last by avion85 14 years, 11 months ago
Hi there. I have just finished working on my game project for this semester, and suddenly I have no project to work on. I thought it would be nice to puzzle my head with some physics over the summer. More accurately the workings behind Rigid Body Dynamics. I have fairly good knowledge in c++, and a bit above basic knowledge in math. ( that is, I have taken a course on integrals and derivatives ) My problem is that I don't really know where to start. Wikipedia doesn't seem like a solution, so I wonder where other people started out. Bare in mind that I have a limited knowledge in math and physics. I want to learn. So if anyone has some good tutorials/articles that explains RBD in a pedagogical fashion, that would be great! Thanks in advance Christo
Advertisement
Quote:Original post by nomonkeybusiness
Hi there.
I have just finished working on my game project for this semester, and suddenly I have no project to work on. I thought it would be nice to puzzle my head with some physics over the summer. More accurately the workings behind Rigid Body Dynamics. I have fairly good knowledge in c++, and a bit above basic knowledge in math. ( that is, I have taken a course on integrals and derivatives )
My problem is that I don't really know where to start. Wikipedia doesn't seem like a solution, so I wonder where other people started out. Bare in mind that I have a limited knowledge in math and physics. I want to learn. So if anyone has some good tutorials/articles that explains RBD in a pedagogical fashion, that would be great!

Thanks in advance
Christo


I'm sorry if this is kind of an obtuse answer to your question, but... I am currently in the process of writing a series of physics programming tutorials right now. I'm writing the third tutorial at the moment on fluid dynamics, then an article on deformations based on elasticity theory (A great paper by Matthias Mueller is the source.). I don't have concrete plans on what will be next, so maybe RBD will be a good thing after that. It will be another week or two until that guide is written most likely though. Subscribe to the RSS feed for my blog and you'll eventually get it though. I try to give a little bit of theory in addition to the implementation stuff, so I hope you'll be into that.

http://blog.brandonpelfrey.com

Best of luck, and I hope my stuff helps you!
Chris Hecker's dynamics tutorials also a good start.

Everything is better with Metal.

oliii : Yeah I've been reading some of that, but much of tha math puzzles me. Not because of the equations themself, my problem is to translate it into code.

brandonpelfrey : Looking forward to it :)
I've got some code that's derived from his equations, but no docs.

Ignore the collision detection part. Everything physics related is in the Body class. The response code uses a few things.

mtd : that's the amount of intersection between bodies.
tcoll : time of collision (I'm doing swept tests).
ncoll : normal of collision;
contact : the two contact points on the two bodies.

What the response does is
1) separate intersecting bodies (using the mtd).
2) generate a collision impulse (so they bounce).
3) generate a friction impulse (so it's more fun).

a body has a few properties :
position : 2D cartesian vector representing position of the centre of mass in space
velocity : 2D cartesian vector representing the linear velocity of the body.
orientation : angle of the body (just one float is needed in 2D).
angular velocity : how much it spins.
inverse mass : the inverse of the mass of the body (if body is unperturbed by collisions, invmass = 0).
inverse inertia : the inverse of the angular inertia of the body (if body doesn't spin after collisions, invinertia = 0).

what inertia is for rotations is like what mass is for linear movement. The higher the inertia, the more difficult it is to rotate. The higher the mass, the more difficult it is to push around.

I use the inverse of mass and inertia, so coding inert bodies is easier (set properties to 0, that plugs straight into the equations with no fussing about).

Everything is better with Metal.

There is a sticky thread on physics engines and reference material in this forum. You'll find numerous references there. As a starting point, I highly recommend the Essential Math tutorials, linked in that thread and available for download as powerpoint files. These are the presentations from a 2 day tutorial given at the Game Developer's Conference each year in San Francisco, prepared by industry professionals with a lot of practical experience on making physics fast and robust. You will learn from this a lot of the basic problems and a bit of math. It's a good starting point. There are other references in the sticky thread that cover the math in significant more detail, in addition to other replies to your query here.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
I would start with implementing circle-circle collision detection and response, and then using that as a base for more complicated dynamics. Searching for pool/billiard physics should turn up a bunch of easy to read code.
Theres a great set of video tutorials on game physics by David Bourg, you should be able to find this on gameinstitute.com.
Everything is explained concerning a simple billiards game, all the forces included, the calculations, and the implementation. There are some more complicated examples too.
I am trying to make the same thing as you for my graduation thesis.
good luck!

ps. if you cant find it, send me a pm

This topic is closed to new replies.

Advertisement