Quaternion unwinding prevention