# Specifying inertia for RigidBodies

**0**

I am making a spacecraft simulator where you can build a ship out of modules. Since I know the mass of the modules and I know the location of the center of mass of each module relative to the center of mass of the rigid body, I can calculate the moment of inertia about each of the axes using parallel axis theorem. Since I can't directly set the inverse inertia, I have to find a collider shape that approximates it. Ideally I would find a shape that I can control the inertia about the three axes by specifying the extents along the three axes. A box collider seems to fit the bill and I was able to determine the formula Godot uses for the Moment of Inertia, e.g. Ix = 1/12M*(y^2 + z^2) and similar for Iy and Iz. But in order to determine the extents of the box needed to match the moment of inertia, I would need to solve a system of 3 non-linear equations. Is there an easier way to specify moments of inertia for rigidbodies?

## Comments

3,129AdminWelcome to the forums @ericwood73!

It doesn't look like there is a way to set inertia directly in Godot, not with the current API. It appears that some people have worked around it though. I'd recommend making a proposal on the Godot Proposal's repository, if one is not already opened for this (I didn't see any).

0Thanks for the link. It looks like the workaround is to compute angular velocity ourselves using know moments of inertia about the body axes. The you can use central force to apply all forces through CoM to avoid rotation. Although I've noticed you can also prevent rotation by not having a collider, because that makes inverse inertia 0 which makes inertia infinite.