-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kick Quat
out of VectorSpace
#12762
Comments
Not sure how to label this kind of design issue, so I'm going to leave it marked as bug. :) |
edit: sorry, I said dumb thing, 3d rotations don't commute |
For this to produce anything like a vector space, the quaternions would have to be Abelian. They are not; in fact, SU(2) has rank 1, and its Lie algebra su(2) doesn't even have any Lie subalgebras of dimension 2 (hence no Abelian ones). In other words: it has to be a miracle for addition between two elements to even commute. |
So the action here is to remove the |
Yep! Technically |
- Fixes #[12762](#12762). ## Migration Guide - `Quat` no longer implements `VectorSpace` as unit quaternions don't actually form proper vector spaces. If you're absolutely certain that what you're doing is correct, convert the `Quat` into a `Vec4` and perform the operations before converting back.
Follow-up for #12747
I have filed this as a bug, but it's really more of a matter of philosophy than anything (and it's not really an enhancement...).
What is the issue?
Currently,
Quat
implementsVectorSpace
; however, glam'sQuat
type is supposed to represent unit quaternions (i.e. versors), which do not meaningfully form a vector space over the reals, even though the full quaternion algebra does form a real vector space.The reason that this is bad is because a lot of vector space operations really don't make sense for
Quat
; chief among these isVectorSpace::ZERO
, which always produces an invalid quaternion, but in general, vector space operations will cause unit quaternions to denormalize. In other words,VectorSpace
is at best a collection of convenience methods for quaternions, but they have extremely poor semantics.What is the alternative?
Let's fall in line with the philosophy we landed on for colors: Unit quaternions are not a vector space, and if you want to pretend they are, you can embed them in
Vec4
and perform explicit conversions. e.g.:The text was updated successfully, but these errors were encountered: