mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-05 12:45:11 +08:00
fix bug #42: add missing Transform::Identity()
This commit is contained in:
parent
ecf64d2dc3
commit
b66516e746
@ -198,6 +198,10 @@ public:
|
|||||||
|
|
||||||
/** \sa MatrixBase::setIdentity() */
|
/** \sa MatrixBase::setIdentity() */
|
||||||
void setIdentity() { m_matrix.setIdentity(); }
|
void setIdentity() { m_matrix.setIdentity(); }
|
||||||
|
static const typename MatrixType::IdentityReturnType Identity()
|
||||||
|
{
|
||||||
|
return MatrixType::Identity();
|
||||||
|
}
|
||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
inline Transform& scale(const MatrixBase<OtherDerived> &other);
|
inline Transform& scale(const MatrixBase<OtherDerived> &other);
|
||||||
|
@ -151,7 +151,13 @@ template<typename Scalar> void geometry(void)
|
|||||||
a = ei_random<Scalar>(-Scalar(0.4)*Scalar(M_PI), Scalar(0.4)*Scalar(M_PI));
|
a = ei_random<Scalar>(-Scalar(0.4)*Scalar(M_PI), Scalar(0.4)*Scalar(M_PI));
|
||||||
q1 = AngleAxisx(a, v0.normalized());
|
q1 = AngleAxisx(a, v0.normalized());
|
||||||
Transform3 t0, t1, t2;
|
Transform3 t0, t1, t2;
|
||||||
|
// first test setIdentity() and Identity()
|
||||||
t0.setIdentity();
|
t0.setIdentity();
|
||||||
|
VERIFY_IS_APPROX(t0.matrix(), Transform3::MatrixType::Identity());
|
||||||
|
t0.matrix().setZero();
|
||||||
|
t0 = Transform3::Identity();
|
||||||
|
VERIFY_IS_APPROX(t0.matrix(), Transform3::MatrixType::Identity());
|
||||||
|
|
||||||
t0.linear() = q1.toRotationMatrix();
|
t0.linear() = q1.toRotationMatrix();
|
||||||
t1.setIdentity();
|
t1.setIdentity();
|
||||||
t1.linear() = q1.toRotationMatrix();
|
t1.linear() = q1.toRotationMatrix();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user