The quaternion class used to represent 3D orientations and rotations. More...
Inherits QuaternionBase< Derived >.
Public Member Functions | |
Quaternion () | |
Quaternion (Scalar w, Scalar x, Scalar y, Scalar z) | |
Quaternion (const Scalar *data) | |
template<class Derived > | |
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) | |
![]() | |
Vector3 | _transformVector (Vector3 v) const |
template<class OtherDerived > | |
internal::traits< Derived >::Scalar | angularDistance (const QuaternionBase< OtherDerived > &other) const |
template<typename NewScalarType > | |
internal::cast_return_type < Derived, Quaternion < NewScalarType > >::type | cast () const |
const internal::traits < Derived >::Coefficients & | coeffs () const |
internal::traits< Derived > ::Coefficients & | coeffs () |
Quaternion< Scalar > | conjugate () const |
template<class OtherDerived > | |
Scalar | dot (const QuaternionBase< OtherDerived > &other) const |
Quaternion< Scalar > | inverse () const |
template<class OtherDerived > | |
bool | isApprox (const QuaternionBase< OtherDerived > &other, RealScalar prec=NumTraits< Scalar >::dummy_precision()) const |
Scalar | norm () const |
void | normalize () |
Quaternion< Scalar > | normalized () const |
template<class OtherDerived > | |
Quaternion< typename internal::traits< Derived > ::Scalar > | operator* (const QuaternionBase< OtherDerived > &other) const |
template<class OtherDerived > | |
Derived & | operator*= (const QuaternionBase< OtherDerived > &q) |
Derived & | operator= (const AngleAxisType &aa) |
template<class MatrixDerived > | |
Derived & | operator= (const MatrixBase< MatrixDerived > &xpr) |
template<typename Derived1 , typename Derived2 > | |
Derived & | setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b) |
QuaternionBase & | setIdentity () |
template<class OtherDerived > | |
Quaternion< Scalar > | slerp (Scalar t, const QuaternionBase< OtherDerived > &other) const |
template<class OtherDerived > | |
Quaternion< typename internal::traits< Derived > ::Scalar > | slerp (Scalar t, const QuaternionBase< OtherDerived > &other) const |
Scalar | squaredNorm () const |
Matrix3 | toRotationMatrix () const |
const VectorBlock< const Coefficients, 3 > | vec () const |
VectorBlock< Coefficients, 3 > | vec () |
Scalar | w () const |
Scalar & | w () |
Scalar | x () const |
Scalar & | x () |
Scalar | y () const |
Scalar & | y () |
Scalar | z () const |
Scalar & | z () |
Additional Inherited Members | |
![]() | |
typedef AngleAxis< Scalar > | AngleAxisType |
typedef Matrix< Scalar, 3, 3 > | Matrix3 |
typedef Matrix< Scalar, 3, 1 > | Vector3 |
![]() | |
static Quaternion< Scalar > | Identity () |
The quaternion class used to represent 3D orientations and rotations.
This is defined in the Geometry module.
_Scalar | the scalar type, i.e., the type of the coefficients |
_Options | controls the memory alignement of the coeffecients. 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, quatertions offer the following advantages:
The following two typedefs are provided for convenience:
Quaternionf
for float
Quaterniond
for double
|
inline |
Default constructor leaving the quaternion uninitialized.
|
inline |
Constructs and initializes the quaternion from its four coefficients w, x, y and z.
x
, y
, z
, w
]
|
inline |
Constructs and initialize a quaternion from the array data
|
inline |
Copy constructor
|
inlineexplicit |
Constructs and initializes a quaternion from the angle-axis aa
|
inlineexplicit |
Constructs and initializes a quaternion from either:
|
inlineexplicit |
Explicit copy constructor with scalar conversion