From 33abe75afab26216a299977a3133f05441d997eb Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Thu, 28 Jan 2010 10:32:44 +0100 Subject: [PATCH] Fixed Quaternion operator*= added regression test. --- Eigen/src/Geometry/Quaternion.h | 3 ++- test/geo_quaternion.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h index b8b41ebcf..285a93c15 100644 --- a/Eigen/src/Geometry/Quaternion.h +++ b/Eigen/src/Geometry/Quaternion.h @@ -377,7 +377,8 @@ template template EIGEN_STRONG_INLINE Derived& QuaternionBase::operator*= (const QuaternionBase& other) { - return (derived() = derived() * other.derived()); + derived() = derived() * other.derived(); + return derived(); } /** Rotation of a vector by a quaternion. diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp index 052c01fbf..311ffd2ec 100644 --- a/test/geo_quaternion.cpp +++ b/test/geo_quaternion.cpp @@ -59,6 +59,9 @@ template void quaternion(void) q1.coeffs().setRandom(); VERIFY_IS_APPROX(q1.coeffs(), (q1*q2).coeffs()); + // concatenation + q1 *= q2; + q1 = AngleAxisx(a, v0.normalized()); q2 = AngleAxisx(a, v1.normalized());