MOAB
4.9.3pre
|
The quaternion class used to represent 3D orientations and rotations. More...
#include <Quaternion.h>
Public Types | |
enum | |
typedef QuaternionBase < Quaternion< _Scalar, _Options > > | Base |
typedef _Scalar | Scalar |
typedef internal::traits < Quaternion >::Coefficients | Coefficients |
typedef Base::AngleAxisType | AngleAxisType |
Public Member Functions | |
Quaternion () | |
Quaternion (const Scalar &w, const Scalar &x, const Scalar &y, const Scalar &z) | |
Quaternion (const Scalar *data) | |
template<class Derived > | |
EIGEN_STRONG_INLINE | Quaternion (const QuaternionBase< Derived > &other) |
Quaternion (const AngleAxisType &aa) | |
template<typename Derived > | |
Quaternion (const MatrixBase< Derived > &other) | |
template<typename OtherScalar , int OtherOptions> | |
Quaternion (const Quaternion< OtherScalar, OtherOptions > &other) | |
Coefficients & | coeffs () |
const Coefficients & | coeffs () const |
Static Public Member Functions | |
template<typename Derived1 , typename Derived2 > | |
static Quaternion | FromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
Static Protected Member Functions | |
static EIGEN_STRONG_INLINE void | _check_template_params () |
Protected Attributes | |
Coefficients | m_coeffs |
The quaternion class used to represent 3D orientations and rotations.
_Scalar | the scalar type, i.e., the type of the coefficients |
_Options | controls the memory alignment of the coefficients. Can be # AutoAlign or # DontAlign. Default is AutoAlign. |
This class represents a quaternion that is a convenient representation of orientations and rotations of objects in three dimensions. Compared to other representations like Euler angles or 3x3 matrices, quaternions offer the following advantages:
The following two typedefs are provided for convenience:
Quaternionf
for float
Quaterniond
for double
Definition at line 227 of file Quaternion.h.
typedef Base::AngleAxisType Eigen::Quaternion< _Scalar, _Options >::AngleAxisType |
the equivalent angle-axis type
Reimplemented from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >.
Definition at line 239 of file Quaternion.h.
typedef QuaternionBase<Quaternion<_Scalar,_Options> > Eigen::Quaternion< _Scalar, _Options >::Base |
Reimplemented from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >.
Definition at line 230 of file Quaternion.h.
typedef internal::traits<Quaternion>::Coefficients Eigen::Quaternion< _Scalar, _Options >::Coefficients |
Reimplemented from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >.
Definition at line 238 of file Quaternion.h.
typedef _Scalar Eigen::Quaternion< _Scalar, _Options >::Scalar |
the scalar type of the coefficients
Reimplemented from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >.
Definition at line 233 of file Quaternion.h.
anonymous enum |
Definition at line 231 of file Quaternion.h.
{ NeedsAlignment = internal::traits<Quaternion>::Alignment>0 };
Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | ) | [inline] |
Default constructor leaving the quaternion uninitialized.
Definition at line 242 of file Quaternion.h.
{}
Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | const Scalar & | w, |
const Scalar & | x, | ||
const Scalar & | y, | ||
const Scalar & | z | ||
) | [inline] |
Constructs and initializes the quaternion from its four coefficients w, x, y and z.
x
, y
, z
, w
] Definition at line 251 of file Quaternion.h.
Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | const Scalar * | data | ) | [inline, explicit] |
Constructs and initialize a quaternion from the array data
Definition at line 254 of file Quaternion.h.
: m_coeffs(data) {}
EIGEN_STRONG_INLINE Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | const QuaternionBase< Derived > & | other | ) | [inline] |
Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | const AngleAxisType & | aa | ) | [inline, explicit] |
Constructs and initializes a quaternion from the angle-axis aa
Definition at line 260 of file Quaternion.h.
{ *this = aa; }
Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | const MatrixBase< Derived > & | other | ) | [inline, explicit] |
Constructs and initializes a quaternion from either:
Definition at line 267 of file Quaternion.h.
{ *this = other; }
Eigen::Quaternion< _Scalar, _Options >::Quaternion | ( | const Quaternion< OtherScalar, OtherOptions > & | other | ) | [inline, explicit] |
Explicit copy constructor with scalar conversion
Definition at line 271 of file Quaternion.h.
{ m_coeffs = other.coeffs().template cast<Scalar>(); }
static EIGEN_STRONG_INLINE void Eigen::Quaternion< _Scalar, _Options >::_check_template_params | ( | ) | [inline, static, protected] |
Definition at line 290 of file Quaternion.h.
{ EIGEN_STATIC_ASSERT( (_Options & DontAlign) == _Options, INVALID_MATRIX_TEMPLATE_PARAMETERS) }
Coefficients& Eigen::Quaternion< _Scalar, _Options >::coeffs | ( | ) | [inline] |
Reimplemented from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >.
Definition at line 277 of file Quaternion.h.
{ return m_coeffs;}
const Coefficients& Eigen::Quaternion< _Scalar, _Options >::coeffs | ( | ) | const [inline] |
Reimplemented from Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >.
Definition at line 278 of file Quaternion.h.
{ return m_coeffs;}
Quaternion< Scalar, Options > Eigen::Quaternion< Scalar, Options >::FromTwoVectors | ( | const MatrixBase< Derived1 > & | a, |
const MatrixBase< Derived2 > & | b | ||
) | [static] |
Returns a quaternion representing a rotation between the two arbitrary vectors a and b. In other words, the built rotation represent a rotation sending the line of direction a to the line of direction b, both lines passing through the origin.
Note that the two input vectors do not have to be normalized, and do not need to have the same norm.
Definition at line 625 of file Quaternion.h.
{ Quaternion quat; quat.setFromTwoVectors(a, b); return quat; }
Coefficients Eigen::Quaternion< _Scalar, _Options >::m_coeffs [protected] |
Definition at line 287 of file Quaternion.h.