aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hauke Heibel <hauke.heibel@gmail.com>2010-01-28 10:32:44 +0100
committerGravatar Hauke Heibel <hauke.heibel@gmail.com>2010-01-28 10:32:44 +0100
commit33abe75afab26216a299977a3133f05441d997eb (patch)
treee7b06db403c7ab5fb492bc747bf011439b67500e
parent98a584ceb8dcaf32091c742c294c4c335b46aa1d (diff)
Fixed Quaternion operator*= added regression test.
-rw-r--r--Eigen/src/Geometry/Quaternion.h3
-rw-r--r--test/geo_quaternion.cpp3
2 files changed, 5 insertions, 1 deletions
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 <class Derived>
template <class OtherDerived>
EIGEN_STRONG_INLINE Derived& QuaternionBase<Derived>::operator*= (const QuaternionBase<OtherDerived>& 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<typename Scalar> 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());