I'm coding simple airplane physics, and I need to get the linear velocity of the RigidBody in a local space, in other words, relative to self. (So that I know the velocity on each individual local axis.)
I've tried the to_local() function, but this doesn't work as intended, probably because it is meant to be used for position and not direction.
I know that for converting it from local to global space, one multiplies the vector with transform.basis; but how do I go the other way around?
It looks like that nobody has ever asked this question, so here I'm asking it now.
EDIT: My phrasing seems to be a bit confusing, because "a velocity relative to self" doesn't exist. I mean that I need to get a rotated version of the velocity vector, so that the axes of it are identical with the axes of the RigidBody, but the global direction and magnitude remain the same.