Fixed ticket #104, dependence between GTX_epsilon and GTC_quaternion

This commit is contained in:
Christophe Riccio 2011-06-01 16:17:45 +01:00
parent 54e8df2ff3
commit 6c9364c2e8
2 changed files with 33 additions and 1 deletions

View File

@ -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")

View File

@ -157,6 +157,21 @@ GLM_FUNC_QUALIFIER detail::tvec4<bool> equalEpsilon
abs(x.w - y.w) < epsilon.w);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> equalEpsilon
(
detail::tquat<valType> const & x,
detail::tquat<valType> const & y,
detail::tquat<valType> const & epsilon
)
{
return detail::tvec4<bool>(
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 <typename valType>
GLM_FUNC_QUALIFIER detail::tvec2<bool> notEqualEpsilon
(
@ -199,6 +214,21 @@ GLM_FUNC_QUALIFIER detail::tvec4<bool> notEqualEpsilon
abs(x.w - y.w) >= epsilon.w);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> notEqualEpsilon
(
detail::tquat<valType> const & x,
detail::tquat<valType> const & y,
detail::tquat<valType> const & epsilon
)
{
return detail::tvec4<bool>(
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