From bff4238d154c1bbb37abd5f5df1bf04f0117e2cc Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sat, 15 Aug 2009 10:24:27 +0200 Subject: [PATCH] fix setFromTwoVectors because of the change in sorting of the the singular values --- Eigen/src/Geometry/Quaternion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h index 2f9f97807..3d59533f4 100644 --- a/Eigen/src/Geometry/Quaternion.h +++ b/Eigen/src/Geometry/Quaternion.h @@ -373,7 +373,7 @@ inline Quaternion& Quaternion::setFromTwoVectors(const MatrixBas c = std::max(c,-1); Matrix m; m << v0.transpose(), v1.transpose(); SVD > 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);