epsilon.hpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /// @ref gtc_epsilon
  2. /// @file glm/gtc/epsilon.hpp
  3. ///
  4. /// @see core (dependence)
  5. /// @see gtc_quaternion (dependence)
  6. ///
  7. /// @defgroup gtc_epsilon GLM_GTC_epsilon
  8. /// @ingroup gtc
  9. ///
  10. /// Include <glm/gtc/epsilon.hpp> to use the features of this extension.
  11. ///
  12. /// Comparison functions for a user defined epsilon values.
  13. #pragma once
  14. // Dependencies
  15. #include "../detail/setup.hpp"
  16. #include "../detail/qualifier.hpp"
  17. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  18. # pragma message("GLM: GLM_GTC_epsilon extension included")
  19. #endif
  20. namespace glm
  21. {
  22. /// @addtogroup gtc_epsilon
  23. /// @{
  24. /// Returns the component-wise comparison of |x - y| < epsilon.
  25. /// True if this expression is satisfied.
  26. ///
  27. /// @see gtc_epsilon
  28. template<length_t L, typename T, qualifier Q>
  29. GLM_FUNC_DECL vec<L, bool, Q> epsilonEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T const& epsilon);
  30. /// Returns the component-wise comparison of |x - y| < epsilon.
  31. /// True if this expression is satisfied.
  32. ///
  33. /// @see gtc_epsilon
  34. template<typename genType>
  35. GLM_FUNC_DECL bool epsilonEqual(genType const& x, genType const& y, genType const& epsilon);
  36. /// Returns the component-wise comparison of |x - y| < epsilon.
  37. /// True if this expression is not satisfied.
  38. ///
  39. /// @see gtc_epsilon
  40. template<length_t L, typename T, qualifier Q>
  41. GLM_FUNC_DECL vec<L, bool, Q> epsilonNotEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T const& epsilon);
  42. /// Returns the component-wise comparison of |x - y| >= epsilon.
  43. /// True if this expression is not satisfied.
  44. ///
  45. /// @see gtc_epsilon
  46. template<typename genType>
  47. GLM_FUNC_DECL bool epsilonNotEqual(genType const& x, genType const& y, genType const& epsilon);
  48. /// @}
  49. }//namespace glm
  50. #include "epsilon.inl"