* rename TranformationKnowledge to TransformTraits

* apply the same principle to extractRotation and fix it to
  extract a rotation corresponding to a positive scaling
This commit is contained in:
Gael Guennebaud
2008-08-30 15:22:45 +00:00
parent 236b7a545d
commit f1e6c56b77
2 changed files with 60 additions and 28 deletions

View File

@@ -25,6 +25,7 @@
#include "main.h"
#include <Eigen/Geometry>
#include <Eigen/LU>
#include <Eigen/QR>
template<typename Scalar> void geometry(void)
{
@@ -231,12 +232,18 @@ template<typename Scalar> void geometry(void)
t0.setIdentity();
t0.translate(v0).rotate(q1);
VERIFY_IS_APPROX(t0.inverse(NoScaling), t0.matrix().inverse());
// test extract rotation
t0.setIdentity();
t0.translate(v0).rotate(q1).scale(v1);
VERIFY_IS_APPROX(t0.extractRotation(GenericAffine) * v1, Matrix3(q1) * v1);
VERIFY_IS_APPROX(t0.extractRotation(NoShear) * v1, Matrix3(q1) * v1);
}
void test_geometry()
{
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( geometry<float>() );
CALL_SUBTEST( geometry<double>() );
// CALL_SUBTEST( geometry<double>() );
}
}