mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-09 06:31:47 +08:00
Add missing default ctor in Rotation2D
This commit is contained in:
parent
e395a8042a
commit
7d5e16c733
@ -59,7 +59,10 @@ protected:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
/** Construct a 2D counter clock wise rotation from the angle \a a in radian. */
|
/** Construct a 2D counter clock wise rotation from the angle \a a in radian. */
|
||||||
inline Rotation2D(const Scalar& a) : m_angle(a) {}
|
explicit inline Rotation2D(const Scalar& a) : m_angle(a) {}
|
||||||
|
|
||||||
|
/** Default constructor wihtout initialization. The represented rotation is undefined. */
|
||||||
|
Rotation2D() {}
|
||||||
|
|
||||||
/** \returns the rotation angle */
|
/** \returns the rotation angle */
|
||||||
inline Scalar angle() const { return m_angle; }
|
inline Scalar angle() const { return m_angle; }
|
||||||
@ -81,10 +84,10 @@ public:
|
|||||||
/** Applies the rotation to a 2D vector */
|
/** Applies the rotation to a 2D vector */
|
||||||
Vector2 operator* (const Vector2& vec) const
|
Vector2 operator* (const Vector2& vec) const
|
||||||
{ return toRotationMatrix() * vec; }
|
{ return toRotationMatrix() * vec; }
|
||||||
|
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
Rotation2D& fromRotationMatrix(const MatrixBase<Derived>& m);
|
Rotation2D& fromRotationMatrix(const MatrixBase<Derived>& m);
|
||||||
Matrix2 toRotationMatrix(void) const;
|
Matrix2 toRotationMatrix() const;
|
||||||
|
|
||||||
/** \returns the spherical interpolation between \c *this and \a other using
|
/** \returns the spherical interpolation between \c *this and \a other using
|
||||||
* parameter \a t. It is in fact equivalent to a linear interpolation.
|
* parameter \a t. It is in fact equivalent to a linear interpolation.
|
||||||
|
@ -397,6 +397,15 @@ template<typename Scalar, int Mode, int Options> void transformations()
|
|||||||
t20 = Translation2(v20) * (Rotation2D<Scalar>(s0) * Eigen::Scaling(s0));
|
t20 = Translation2(v20) * (Rotation2D<Scalar>(s0) * Eigen::Scaling(s0));
|
||||||
t21 = Translation2(v20) * Rotation2D<Scalar>(s0) * Eigen::Scaling(s0);
|
t21 = Translation2(v20) * Rotation2D<Scalar>(s0) * Eigen::Scaling(s0);
|
||||||
VERIFY_IS_APPROX(t20,t21);
|
VERIFY_IS_APPROX(t20,t21);
|
||||||
|
|
||||||
|
// check basic features
|
||||||
|
{
|
||||||
|
Rotation2D<Scalar> r1; // default ctor
|
||||||
|
r1 = Rotation2D<Scalar>(s0); // copy assignment
|
||||||
|
VERIFY_IS_APPROX(r1.angle(),s0);
|
||||||
|
Rotation2D<Scalar> r2(r1); // copy ctor
|
||||||
|
VERIFY_IS_APPROX(r2.angle(),s0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Scalar> void transform_alignment()
|
template<typename Scalar> void transform_alignment()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user