9
3

epsilon.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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"