mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-13 18:37:27 +08:00
Transform is now per default Projective.
Improved invert() in the Transform class. RotationBase offers matrix() to be conform with Transform's naming scheme. Added Translation::translation() to be conform with Transform's naming scheme.
This commit is contained in:
parent
2f0e8904f1
commit
6b89ee0095
@ -180,7 +180,7 @@ template<typename Derived> class QuaternionBase;
|
||||
template<typename Scalar> class Quaternion;
|
||||
template<typename Scalar> class Rotation2D;
|
||||
template<typename Scalar> class AngleAxis;
|
||||
template<typename Scalar,int Dim,int Mode=Affine> class Transform;
|
||||
template<typename Scalar,int Dim,int Mode=Projective> class Transform;
|
||||
template <typename _Scalar, int _AmbientDim> class ParametrizedLine;
|
||||
template <typename _Scalar, int _AmbientDim> class Hyperplane;
|
||||
template<typename Scalar,int Dim> class Translation;
|
||||
|
@ -55,6 +55,11 @@ class RotationBase
|
||||
/** \returns an equivalent rotation matrix */
|
||||
inline RotationMatrixType toRotationMatrix() const { return derived().toRotationMatrix(); }
|
||||
|
||||
/** \returns an equivalent rotation matrix
|
||||
* This function is added to be conform with the Transform class' naming scheme.
|
||||
*/
|
||||
inline RotationMatrixType matrix() const { return derived().toRotationMatrix(); }
|
||||
|
||||
/** \returns the inverse rotation */
|
||||
inline Derived inverse() const { return derived().inverse(); }
|
||||
|
||||
|
@ -954,11 +954,6 @@ Transform<Scalar,Dim,Mode>::inverse(TransformTraits hint) const
|
||||
// translation and remaining parts
|
||||
res.matrix().template topRightCorner<Dim,1>()
|
||||
= - res.matrix().template topLeftCorner<Dim,Dim>() * translation();
|
||||
if(int(Mode)!=int(AffineCompact))
|
||||
{
|
||||
res.matrix().template block<1,Dim>(Dim,0).setZero();
|
||||
res.matrix().coeffRef(Dim,Dim) = 1;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -98,6 +98,9 @@ public:
|
||||
const VectorType& vector() const { return m_coeffs; }
|
||||
VectorType& vector() { return m_coeffs; }
|
||||
|
||||
const VectorType& translation() const { return m_coeffs; }
|
||||
VectorType& translation() { return m_coeffs; }
|
||||
|
||||
/** Concatenates two translation */
|
||||
inline Translation operator* (const Translation& other) const
|
||||
{ return Translation(m_coeffs + other.m_coeffs); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user