Why is Unity using a Quaternion for rotation, but a Vector3 for angular velocity?


Because not only is a Vector3 more compact, a quaternion can only represent a rotation of up to +/- 1 turn signed.

If you’re storing angular velocity as “rotations per second” your object could be spinning at more than 1 rotation per second, a quaternion doesn’t work for this (even if you chose a smaller time base you will reach a similar problem)

A Vector3 angular velocity can be longer than 1 unit of length to represent faster rotations than a quaternion could.

It’s also much easier to work with when calculating friction, combining/adding angular velocity, multiplying by the frame delta time, clamping rotation speed (a simple vector length check), etc



Source link

More To Explore

Share on facebook
Share on twitter
Share on linkedin
Share on email