From 2bb0fb39998a55b6843261d714d8067e6d12b40a Mon Sep 17 00:00:00 2001 From: EZForever <34133756+EZForever@users.noreply.github.com> Date: Wed, 28 Oct 2020 17:26:53 +0800 Subject: [PATCH] Add test case for glm::angle() sign bug introduced by #946 --- test/ext/ext_quaternion_trigonometric.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/ext/ext_quaternion_trigonometric.cpp b/test/ext/ext_quaternion_trigonometric.cpp index 1c1d6084..d2371252 100644 --- a/test/ext/ext_quaternion_trigonometric.cpp +++ b/test/ext/ext_quaternion_trigonometric.cpp @@ -21,6 +21,12 @@ static int test_angle() Error += glm::equal(A, 90.0f, Epsilon) ? 0 : 1; } + { + glm::quat const Q = glm::angleAxis(glm::two_pi() - 1.0f, glm::vec3(1, 0, 0)); + float const A = glm::angle(Q); + Error += glm::equal(A, 1.0f, Epsilon) ? 1 : 0; + } + return Error; }