From 6c9364c2e847876caaba06d95434aaef61630c4d Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 1 Jun 2011 16:17:45 +0100 Subject: [PATCH] Fixed ticket #104, dependence between GTX_epsilon and GTC_quaternion --- glm/gtx/epsilon.hpp | 4 +++- glm/gtx/epsilon.inl | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/glm/gtx/epsilon.hpp b/glm/gtx/epsilon.hpp index 7df2cb7d..3ee7f418 100644 --- a/glm/gtx/epsilon.hpp +++ b/glm/gtx/epsilon.hpp @@ -8,7 +8,8 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// // Dependency: // - GLM core -// - GLM_GTX_half +// - GLM_GTC_half_float +// - GLM_GTC_quaternion /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtx_epsilon @@ -17,6 +18,7 @@ // Dependency: #include "../glm.hpp" #include "../gtc/half_float.hpp" +#include "../gtc/quaternion.hpp" #if(defined(GLM_MESSAGES) && !defined(glm_ext)) # pragma message("GLM: GLM_GTX_epsilon extension included") diff --git a/glm/gtx/epsilon.inl b/glm/gtx/epsilon.inl index 1e424127..4eab9103 100644 --- a/glm/gtx/epsilon.inl +++ b/glm/gtx/epsilon.inl @@ -157,6 +157,21 @@ GLM_FUNC_QUALIFIER detail::tvec4 equalEpsilon abs(x.w - y.w) < epsilon.w); } +template +GLM_FUNC_QUALIFIER detail::tvec4 equalEpsilon +( + detail::tquat const & x, + detail::tquat const & y, + detail::tquat const & epsilon +) +{ + return detail::tvec4( + abs(x.x - y.x) < epsilon.x, + abs(x.y - y.y) < epsilon.y, + abs(x.z - y.z) < epsilon.z, + abs(x.w - y.w) < epsilon.w); +} + template GLM_FUNC_QUALIFIER detail::tvec2 notEqualEpsilon ( @@ -199,6 +214,21 @@ GLM_FUNC_QUALIFIER detail::tvec4 notEqualEpsilon abs(x.w - y.w) >= epsilon.w); } +template +GLM_FUNC_QUALIFIER detail::tvec4 notEqualEpsilon +( + detail::tquat const & x, + detail::tquat const & y, + detail::tquat const & epsilon +) +{ + return detail::tvec4( + abs(x.x - y.x) >= epsilon.x, + abs(x.y - y.y) >= epsilon.y, + abs(x.z - y.z) >= epsilon.z, + abs(x.w - y.w) >= epsilon.w); +} + }//namespace epsilon }//namespace gtx }//namespace glm