Hello folks!

I’m in a bit of a pickle trying to implement a stable spring-damper system for a physics game. Essentially, what I’m trying to do is to implement a semi stiff rotational relationship between two rigid bodies (I can’t use joints for this). I came across an implementation I’d like to try at

https://www.gamedev.net/tutorials/programming/math-and-physics/towards-a-simpler-stiffer-and-more-stable-spring-r3227/

but it requires the inertia for the objects in question. The problem is that I can’t seem to find a way to get that value. I am aware that rigidbodies have a inertia tensor (not something I fully understand but I think I get the picture) but I can’t seem to figure out how to use this to get the value that I need.

So in summary, I’m trying to figure out the inertia of any rigidbody around a given axis. Also I’d like to understand what happens if the axis does not go through the center of mass of the of the rigidbody.

Thanks for the help and sorry if I butchered the explanation