@DanHugo said:
Thanks for the response, TwistedTwigleg. :) I'll check out the Reddit. Just curious... when you say "_intergrate_forces function is not working for RigidBody nodes", what do you mean exactly?
Sorry, I should have explained better.
Last I knew, and maybe it is fixed now, the _intergrate_forces function does not work with the Bullet physics engine Godot uses. It still works fine with the old custom Godot physics engine, but apparently there was some issues getting it to work with Bullet and ultimately I think it was disabled.
I could be wrong though, it’s been awhile since I’ve read anything about it so maybe it’s working now.
I eventually worked out that the moment of inertia properties -- named inverse_inertia and principal_inertia_axes -- are available in PhysicsDirectBodyState class, meaning it's accessible via the rigidbody's state variable in _integrate_forces (and probably not arbitrarily settable). Experimentally, center_of_mass appears to simply be the translation of the RigidBody, unaffected by collider geometry. Meanwhile, I can't quite work out how moment of inertia is determined, as it's possible to build objects from a pair of box colliders and get some unexpected values. For a single box collider, inverse_inertia and principal_inertia_axes vary with scale, but not with translation of collider away from the centre_of_mass... this seems like a contradiction to me, but maybe I need to read up on the physics a bit. :)
Sounds complicated, but I’ve never been particularly good with physics. I wish you the best of luck figuring everything out.