fix setFromTwoVectors because of the change in sorting of the the singular values

This commit is contained in:
Gael Guennebaud 2009-08-15 10:24:27 +02:00
parent 109a4f650b
commit bff4238d15

View File

@ -373,7 +373,7 @@ inline Quaternion<Scalar>& Quaternion<Scalar>::setFromTwoVectors(const MatrixBas
c = std::max<Scalar>(c,-1);
Matrix<Scalar,2,3> m; m << v0.transpose(), v1.transpose();
SVD<Matrix<Scalar,2,3> > svd(m);
Vector3 axis = svd.matrixV().col(2);
Vector3 axis = svd.matrixV().col(0);
Scalar w2 = (Scalar(1)+c)*Scalar(0.5);
this->w() = ei_sqrt(w2);