From d9124820ed293dfc017e2ca9da20cfb882661a43 Mon Sep 17 00:00:00 2001 From: Gottfried Leibniz <37632412+gottfriedleibniz@users.noreply.github.com> Date: Tue, 22 Sep 2020 00:29:59 -0300 Subject: [PATCH 1/4] fix: fastExp promotion implicit conversion increases floating-point precision: 'float' to 'double' --- glm/gtx/fast_exponential.inl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glm/gtx/fast_exponential.inl b/glm/gtx/fast_exponential.inl index f139e505..5b117424 100644 --- a/glm/gtx/fast_exponential.inl +++ b/glm/gtx/fast_exponential.inl @@ -112,7 +112,7 @@ namespace glm template GLM_FUNC_QUALIFIER genType fastExp2(genType x) { - return fastExp(0.69314718055994530941723212145818f * x); + return fastExp(static_cast(0.69314718055994530941723212145818) * x); } template @@ -125,7 +125,7 @@ namespace glm template GLM_FUNC_QUALIFIER genType fastLog2(genType x) { - return fastLog(x) / 0.69314718055994530941723212145818f; + return fastLog(x) / static_cast(0.69314718055994530941723212145818); } template From c18ec93b0ea5034ff2779863c7bb3ee0fa6a485d Mon Sep 17 00:00:00 2001 From: Gottfried Leibniz <37632412+gottfriedleibniz@users.noreply.github.com> Date: Tue, 22 Sep 2020 00:36:43 -0300 Subject: [PATCH 2/4] fix: orientate3 types --- glm/gtx/euler_angles.inl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/glm/gtx/euler_angles.inl b/glm/gtx/euler_angles.inl index 68c50124..3f13df68 100644 --- a/glm/gtx/euler_angles.inl +++ b/glm/gtx/euler_angles.inl @@ -665,13 +665,13 @@ namespace glm mat<3, 3, T, defaultp> Result; Result[0][0] = c; Result[0][1] = s; - Result[0][2] = 0.0f; + Result[0][2] = T(0.0); Result[1][0] = -s; Result[1][1] = c; - Result[1][2] = 0.0f; - Result[2][0] = 0.0f; - Result[2][1] = 0.0f; - Result[2][2] = 1.0f; + Result[1][2] = T(0.0); + Result[2][0] = T(0.0); + Result[2][1] = T(0.0); + Result[2][2] = T(1.0); return Result; } From 96558e896b24bba1c02edeb85e6aff1155bf9d80 Mon Sep 17 00:00:00 2001 From: Gottfried Leibniz <37632412+gottfriedleibniz@users.noreply.github.com> Date: Tue, 22 Sep 2020 00:37:56 -0300 Subject: [PATCH 3/4] fix: intersectLineTriangle types --- glm/gtx/intersect.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtx/intersect.inl b/glm/gtx/intersect.inl index 54ecb4d9..95e81e8b 100644 --- a/glm/gtx/intersect.inl +++ b/glm/gtx/intersect.inl @@ -108,7 +108,7 @@ namespace glm genType Perpendicular = cross(dir, edge2); - float det = dot(edge1, Perpendicular); + typename genType::value_type det = dot(edge1, Perpendicular); if (det > -Epsilon && det < Epsilon) return false; From ebf4e9eaa2dfe5ae27ec7f7a8aa8ddda244b4f08 Mon Sep 17 00:00:00 2001 From: Gottfried Leibniz <37632412+gottfriedleibniz@users.noreply.github.com> Date: Tue, 22 Sep 2020 00:40:47 -0300 Subject: [PATCH 4/4] fix: unpackUnorm type --- glm/gtc/packing.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtc/packing.inl b/glm/gtc/packing.inl index 8c906e16..84ad60c7 100644 --- a/glm/gtc/packing.inl +++ b/glm/gtc/packing.inl @@ -683,7 +683,7 @@ namespace detail GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - return vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())); + return vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())); } template