Let's be safe: enable auto normalization is quaternion to angle-axis code since a slight numerical issue may trigger NaN. The overhead is small and I doubt the perf of this function could be critival for any application !

This commit is contained in:
Gael Guennebaud 2010-10-31 23:26:01 +01:00
parent 006c9a5105
commit c7eda0d866

View File

@ -176,7 +176,7 @@ AngleAxis<Scalar>& AngleAxis<Scalar>::operator=(const QuaternionBase<QuatDerived
}
else
{
m_angle = 2*std::acos(q.w());
m_angle = Scalar(2)*std::acos(q.w()/*/internal::sqrt(n2+q.w()*q.w())*/);
m_axis = q.vec() / internal::sqrt(n2);
}
return *this;