From ef9f9f80283cdb308ee9b4f730be64de7d9c0572 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 16 Aug 2018 09:57:34 +0200 Subject: [PATCH] Added rotate test --- test/ext/ext_matrix_transform.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/ext/ext_matrix_transform.cpp b/test/ext/ext_matrix_transform.cpp index 4158dcda..cf653b7d 100644 --- a/test/ext/ext_matrix_transform.cpp +++ b/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; }