From 09c5e29f6364433a4bbd5c20222d1be93bbb1c5f Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 16 Aug 2014 16:57:08 -0700 Subject: [PATCH] Add a vector translation multiplication test --- test/test_basics.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/test_basics.cc b/test/test_basics.cc index d539efe..b07ec78 100644 --- a/test/test_basics.cc +++ b/test/test_basics.cc @@ -295,6 +295,18 @@ TEST_F(Matrix4Test, IdentityVectorMultiplication) } +TEST_F(Matrix4Test, TranslationVectorMultiplication) +{ + Matrix4 tr = Matrix4::Translation(1, 2, 3); + Vector4 v1(3, 7, 9); + + Vector4 p1 = tr * v1; + EXPECT_EQ(p1.X(), 4.0); + EXPECT_EQ(p1.Y(), 9.0); + EXPECT_EQ(p1.Z(), 12.0); +} + + TEST_F(Matrix4Test, Transpose) { Matrix4 t1 = Transpose(m1);