mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 20:56:00 +08:00
add quaternion Options, add unaligned possibility
This commit is contained in:
parent
9ccd16609c
commit
0aa752fc4f
@ -220,7 +220,7 @@ template<typename Scalar> class JacobiRotation;
|
|||||||
template<typename Derived, int _Dim> class RotationBase;
|
template<typename Derived, int _Dim> class RotationBase;
|
||||||
template<typename Lhs, typename Rhs> class Cross;
|
template<typename Lhs, typename Rhs> class Cross;
|
||||||
template<typename Derived> class QuaternionBase;
|
template<typename Derived> class QuaternionBase;
|
||||||
template<typename Scalar> class Quaternion;
|
template<typename Scalar, int Options = AutoAlign> class Quaternion;
|
||||||
template<typename Scalar> class Rotation2D;
|
template<typename Scalar> class Rotation2D;
|
||||||
template<typename Scalar> class AngleAxis;
|
template<typename Scalar> class AngleAxis;
|
||||||
template<typename Scalar,int Dim> class Translation;
|
template<typename Scalar,int Dim> class Translation;
|
||||||
|
@ -215,28 +215,28 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
template<typename _Scalar>
|
template<typename _Scalar,int _Options>
|
||||||
struct traits<Quaternion<_Scalar> >
|
struct traits<Quaternion<_Scalar,_Options> >
|
||||||
{
|
{
|
||||||
typedef Quaternion<_Scalar> PlainObject;
|
typedef Quaternion<_Scalar,_Options> PlainObject;
|
||||||
typedef _Scalar Scalar;
|
typedef _Scalar Scalar;
|
||||||
typedef Matrix<_Scalar,4,1> Coefficients;
|
typedef Matrix<_Scalar,4,1,_Options> Coefficients;
|
||||||
enum{
|
enum{
|
||||||
PacketAccess = Aligned
|
PacketAccess = _Options & DontAlign ? Unaligned : Aligned
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename _Scalar>
|
template<typename _Scalar, int _Options>
|
||||||
class Quaternion : public QuaternionBase<Quaternion<_Scalar> >{
|
class Quaternion : public QuaternionBase<Quaternion<_Scalar,_Options> >{
|
||||||
typedef QuaternionBase<Quaternion<_Scalar> > Base;
|
typedef QuaternionBase<Quaternion<_Scalar,_Options> > Base;
|
||||||
public:
|
public:
|
||||||
typedef _Scalar Scalar;
|
typedef _Scalar Scalar;
|
||||||
|
|
||||||
EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Quaternion<Scalar>)
|
EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Quaternion)
|
||||||
using Base::operator*=;
|
using Base::operator*=;
|
||||||
|
|
||||||
typedef typename internal::traits<Quaternion<Scalar> >::Coefficients Coefficients;
|
typedef typename internal::traits<Quaternion<Scalar,_Options> >::Coefficients Coefficients;
|
||||||
typedef typename Base::AngleAxisType AngleAxisType;
|
typedef typename Base::AngleAxisType AngleAxisType;
|
||||||
|
|
||||||
/** Default constructor leaving the quaternion uninitialized. */
|
/** Default constructor leaving the quaternion uninitialized. */
|
||||||
@ -272,6 +272,14 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
Coefficients m_coeffs;
|
Coefficients m_coeffs;
|
||||||
|
|
||||||
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||||
|
EIGEN_STRONG_INLINE static void _check_template_params()
|
||||||
|
{
|
||||||
|
EIGEN_STATIC_ASSERT( (_Options & DontAlign) == _Options,
|
||||||
|
INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/** \ingroup Geometry_Module
|
/** \ingroup Geometry_Module
|
||||||
|
Loading…
x
Reference in New Issue
Block a user