Browse Source

Added rotate test

Christophe Riccio 7 years ago
parent
commit
ef9f9f8028
1 changed files with 14 additions and 0 deletions
  1. 14 0
      test/ext/ext_matrix_transform.cpp

+ 14 - 0
test/ext/ext_matrix_transform.cpp

@@ -36,12 +36,26 @@ static int test_scale()
 	return Error;
 }
 
+static int test_rotate()
+{
+	int Error = 0;
+
+	glm::vec4 const A(1.0f, 0.0f, 0.0f, 1.0f);
+
+	glm::mat4 const R = glm::rotate(glm::mat4(1.0f), glm::radians(90.f), glm::vec3(0, 0, 1));
+	glm::vec4 const B = R * A;
+	Error += glm::all(glm::equal(B, glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.0001f)) ? 0 : 1;
+
+	return Error;
+}
+
 int main()
 {
 	int Error = 0;
 
 	Error += test_translate();
 	Error += test_scale();
+	Error += test_rotate();
 
 	return Error;
 }