mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 09:39:33 +00:00
Return zero rotation vector when converting neutral quaternion
Previously it would return nans
This commit is contained in:
parent
9229b743eb
commit
48c7135efb
@ -84,6 +84,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Vector toRotationVector() const {
|
Vector toRotationVector() const {
|
||||||
|
if (w == 1 && x == 0 && y == 0 && z == 0) return Vector(0, 0, 0); // neutral quaternion
|
||||||
float angle;
|
float angle;
|
||||||
Vector axis;
|
Vector axis;
|
||||||
toAxisAngle(axis, angle);
|
toAxisAngle(axis, angle);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user