Get/set the _local_ angular velocity of a rigid body

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 ?

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);
1 Like

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