diff options
author | Mathieu Gautier <mathieu.gautier@cea.fr> | 2009-11-13 16:41:51 +0100 |
---|---|---|
committer | Mathieu Gautier <mathieu.gautier@cea.fr> | 2009-11-13 16:41:51 +0100 |
commit | 6680fa42ee830d315db8879d7b0746c68bdcba4e (patch) | |
tree | 0d734759e942263ba26d89eaa805e383ba10a21b /Eigen/src/Geometry/AngleAxis.h | |
parent | d07c05b3a5e338a018e7b0992f32f45ef2f12495 (diff) |
* add Map<Quaternion> test based on Map from test/map.cpp
* replace implicit constructor AngleAxis(QuaternionBase&) by an explicit one, it seems ambiguous for the compiler
* remove explicit constructor with conversion type quaternion(Quaternion&): conflict between constructor.
* modify EIGEN_INHERIT_ASSIGNEMENT_OPERATORS to suit Quaternion class
Diffstat (limited to 'Eigen/src/Geometry/AngleAxis.h')
-rw-r--r-- | Eigen/src/Geometry/AngleAxis.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Eigen/src/Geometry/AngleAxis.h b/Eigen/src/Geometry/AngleAxis.h index b9dfa6972..ef86eb20d 100644 --- a/Eigen/src/Geometry/AngleAxis.h +++ b/Eigen/src/Geometry/AngleAxis.h @@ -89,7 +89,7 @@ public: template<typename Derived> inline AngleAxis(Scalar angle, const MatrixBase<Derived>& axis) : m_axis(axis), m_angle(angle) {} /** Constructs and initialize the angle-axis rotation from a quaternion \a q. */ - inline AngleAxis(const QuaternionType& q) { *this = q; } + template<typename QuatDerived> inline explicit AngleAxis(const QuaternionBase<QuatDerived>& q) { *this = q; } /** Constructs and initialize the angle-axis rotation from a 3x3 rotation matrix. */ template<typename Derived> inline explicit AngleAxis(const MatrixBase<Derived>& m) { *this = m; } @@ -116,7 +116,8 @@ public: AngleAxis inverse() const { return AngleAxis(-m_angle, m_axis); } - AngleAxis& operator=(const QuaternionType& q); + template<class QuatDerived> + AngleAxis& operator=(const QuaternionBase<QuatDerived>& q); template<typename Derived> AngleAxis& operator=(const MatrixBase<Derived>& m); @@ -160,7 +161,8 @@ typedef AngleAxis<double> AngleAxisd; * The axis is normalized. */ template<typename Scalar> -AngleAxis<Scalar>& AngleAxis<Scalar>::operator=(const QuaternionType& q) +template<typename QuatDerived> +AngleAxis<Scalar>& AngleAxis<Scalar>::operator=(const QuaternionBase<QuatDerived>& q) { Scalar n2 = q.vec().squaredNorm(); if (n2 < precision<Scalar>()*precision<Scalar>()) |