Moment of Inertia

Official forum for the Chipmunk2D Physics Library.
Post Reply
Draxis
Posts: 2
Joined: Mon May 31, 2010 1:58 am
Contact:

Moment of Inertia

Post by Draxis »

Hi all, quick question - I am trying to get the moment of inertia for a body that has 3 polygon shapes added to it. Is it as simple as adding the moments of inertia for the 3 shapes?
mobilebros
Posts: 90
Joined: Tue Aug 04, 2009 9:53 am
Contact:

Re: Moment of Inertia

Post by mobilebros »

Unfortunately its not quite as simple.... see post here:

http://www.slembcke.net/forums/viewtopi ... 977&hilit=

I also implemented a function to combine shape/body pairs into one shared body (somewhat similar) in objective-c in the SpaceManager project. One caveat being that the function uses the OLD moment of inertia to calculate the new.....

Anyway here's a direct link to the source; you'll be looking at the combineShapes and offsetShape functions (beware the large commented-out block in combineShapes, its hard to see that in a browser):

http://code.google.com/p/chipmunk-space ... Manager.mm
Draxis
Posts: 2
Joined: Mon May 31, 2010 1:58 am
Contact:

Re: Moment of Inertia

Post by Draxis »

Ok, that doesnt seem too bad. It certainly beats trying to decipher a wall of equations on a physics forum. Thanks for your help.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests