aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/geo_transformations.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2010-03-02 17:38:40 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2010-03-02 17:38:40 +0100
commitc7828ac45c151caad4afdbe6fc26ca989fef4337 (patch)
treef21a521bda32e5780133b20262067f23c1055472 /test/geo_transformations.cpp
parent2f3d685e0c687ae1121428dab6bc0ec868b14fe3 (diff)
add missing implementation of uniform scaling products
Diffstat (limited to 'test/geo_transformations.cpp')
-rw-r--r--test/geo_transformations.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/geo_transformations.cpp b/test/geo_transformations.cpp
index 895fe0f08..b1a50f6b2 100644
--- a/test/geo_transformations.cpp
+++ b/test/geo_transformations.cpp
@@ -59,6 +59,7 @@ template<typename Scalar, int Mode> void transformations(void)
Matrix3 matrot1, m;
Scalar a = ei_random<Scalar>(-Scalar(M_PI), Scalar(M_PI));
+ Scalar s0 = ei_random<Scalar>();
VERIFY_IS_APPROX(v0, AngleAxisx(a, v0.normalized()) * v0);
VERIFY_IS_APPROX(-v0, AngleAxisx(Scalar(M_PI), v0.unitOrthogonal()) * v0);
@@ -234,6 +235,16 @@ template<typename Scalar, int Mode> void transformations(void)
t1 = Matrix3(q1) * (AlignedScaling3(v0) * Translation3(v0));
VERIFY_IS_APPROX(t0.matrix(), t1.matrix());
+
+ t0.setIdentity();
+ t0.scale(s0).translate(v0);
+ t1 = Scaling(s0) * Translation3(v0);
+ VERIFY_IS_APPROX(t0.matrix(), t1.matrix());
+ t0.prescale(s0);
+ t1 = Scaling(s0) * t1;
+ VERIFY_IS_APPROX(t0.matrix(), t1.matrix());
+
+
t0.setIdentity();
t0.prerotate(q1).prescale(v0).pretranslate(v0);
// translation * aligned scaling and transformation * mat