I need to convert some old code, but i cannot find the right methods in the new math library
Can you guys help me?
var localMovement= transform.InverseTransformDirection(_rigidbody.velocity);
//[...] some transformation of localMovement
_rigidbody.velocity = transform.TransformDirection(localMovement);
var localMovement= math.rotate(math.inverse(transform.rotation), _rigidbody.velocity);
//[...] some transformation of localMovement
_rigidbody.velocity = math.rotate(transform.rotation, localMovement);
The important thing here is that Unity.Mathematics.math works with Unity.Mathematics.quaternion, which you will be using a lot. Unity.Mathematics.quaternion has some quirks, though. Such as .Euler requiring Radians instead of Degrees.