TEST(M4x4, orthoProj) { Matrix4x4 testMatrix; testMatrix.FillMatrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); Matrix4x4 result; result.FillMatrix(2,0,0,0,0,2,0,0,0,0,-1,0,3,3,1,1); EXPECT_EQ(result, testMatrix.SetOrthographicProjection(1,2,2,1,2,1)); }
TEST(M4x4, scale) { Matrix4x4 testMatrix; testMatrix.FillMatrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); Vector4D testVector; testVector.x = 1; testVector.y = 1; testVector.z = 1; testVector.w = 1; Matrix4x4 result; result.FillMatrix(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1); EXPECT_EQ(result, testMatrix.SetScale(testVector)); }
TEST(M4x4, rotate) { Matrix4x4 testMatrix; testMatrix.FillMatrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); Vector4D testVector; testVector.x = 1; testVector.y = 1; testVector.z = 1; testVector.w = 1; Matrix4x4 result; result.FillMatrix(1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1); ; EXPECT_EQ(result, testMatrix.SetRotate(testVector, 0)); }
TEST(M4x4, opIsEqualFriend) { Matrix4x4 testMatrix; testMatrix.FillMatrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); Matrix4x4 result; result = testMatrix; EXPECT_EQ(true, operator==(testMatrix,result)); }
TEST(M4x4, opEqual) { Matrix4x4 testMatrix; testMatrix.FillMatrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); Matrix4x4 result; result = testMatrix; EXPECT_EQ(result, testMatrix); }
TEST(M4x4, opIsEqual) { Matrix4x4 testMatrix; testMatrix.FillMatrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); Matrix4x4 result; result = testMatrix; bool secondResult = (result == testMatrix); EXPECT_EQ(true, secondResult); }
TEST(M4x4, opMulti) { Matrix4x4 testMatrix0; testMatrix0.FillMatrix(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4); Matrix4x4 testMatrix1; testMatrix1.FillMatrix(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); Matrix4x4 result; //result.FillMatrix(4, 4, 4, 4, 8, 8, 8, 8, 12, 12, 12, 12, 16, 16, 16, 16); result.FillMatrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); EXPECT_EQ(result, testMatrix1); }