Archive 17/01/2023.

Get/set the _local_ angular velocity of a rigid body

rico.decho

I need to do change the local yaw/pitch/roll rotation speeds of a bullet rigid body, in radians per second, independently of its mass.

How can I convert the global angular velocity of a rigid body to its local angular velocity, and vice versa ?

TheComet

You should be able to just multiply it with the node’s transformation matrix.

Vector3 localAngularVelocity = node->GetWorldTransform().Inverse() * globalAngularVelocity;
Vector3 globalAngularVelocity = node->GetWorldTransform() * localAngularVelocity;

Turns out Node already has methods for this:

Vector3 localAngularVelocity = node->WorldToLocal(globalAngularVelocity);
Vector3 globalAngularVelocity = node->LocalToWorld(localAngularVelocity);
rico.decho

Thank you so much ! You made my day !!!