- Home /
Question is off-topic or not relevant
manually calculating Moment of Inertia
Hi,
I know that the rigidbody component calculates the inertia tensor automatically from the colliders attached on the object, but I am trying to find an algorithm that does that as well for some other purposes. so far I was able to write an algorithm that works with some shapes but not all shapes (specifically spherical shapes because of the integration over volume is different, it still thinks its a cubic shape) so I was wondering if someone could help.
Thanks in advance.
Answer by Bunny83 · Sep 15, 2017 at 01:24 AM
I haven't done it myself yet, but I read a lot on that topic a few years ago. You can get the moment of inertia for a lot common shapes from this wikipedia page.
To combine them you would use the parallel axis theorem as mentioned on this SO post
I think this paper covers most of the math you need
first thanks for commenting ! the math needed is not the problem, the problem is using the system to calculate the inertia tensor of an object that has a mesh collider which could take any shape and form, there fails my current system where unity's rigidbody doesn't. so I am just wanting to calculate for mesh colliders not pre-known shapes.
Thanks again !