Converting force and torque from world space to local space

Hi,

i cannot find search button on this new forum :confused:

lets say, when player presses forward button, force vector will be local


Vector3f localForce = new Vector3f(0f, 0f, 1f);

if i want to go forward relative to player, not world, i simply do


Vector3f worldForce = rigidBody.getPhysicsRotation().mult(localForce);
rigidBody.applyCentralForce(worldForce);

but what if i have worldForce and want to convert it back to localForce?

rigidBody.getPhysicsRotation().inverse().mult(worldForce)

1 Like

perfect thanks :slight_smile: