AxisAngle: call q.imag().norm() for conversion

This is important depending on the platform because norm()
calls matrix::squrt() which dispatches correctly to the implementation
for the used type. Otherwise float squrt()s can get calculated as
double.
This commit is contained in:
Matthias Grob 2020-03-12 06:10:44 +01:00 committed by Mathieu Bresciani
parent 4873dc1c1e
commit 2cca35c8fe

View File

@ -69,7 +69,7 @@ public:
AxisAngle(const Quaternion<Type> &q)
{
AxisAngle &v = *this;
Type mag = Type(sqrt(q(1) * q(1) + q(2) * q(2) + q(3) * q(3)));
Type mag = q.imag().norm();
if (fabs(mag) >= Type(1e-10)) {
v = q.imag() * Type(Type(2) * atan2(mag, q(0)) / mag);
} else {