scalar_relational.hpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /// @ref ext_scalar_relational
  2. /// @file glm/ext/scalar_relational.hpp
  3. ///
  4. /// @defgroup ext_scalar_relational GLM_EXT_scalar_relational
  5. /// @ingroup ext
  6. ///
  7. /// Exposes comparison functions for scalar types that take a user defined epsilon values.
  8. ///
  9. /// Include <glm/ext/scalar_relational.hpp> to use the features of this extension.
  10. ///
  11. /// @see core_vector_relational
  12. /// @see ext_vector_relational
  13. /// @see ext_matrix_relational
  14. #pragma once
  15. // Dependencies
  16. #include "../detail/qualifier.hpp"
  17. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  18. # pragma message("GLM: GLM_EXT_scalar_relational extension included")
  19. #endif
  20. namespace glm
  21. {
  22. /// Returns the component-wise comparison of |x - y| < epsilon.
  23. /// True if this expression is satisfied.
  24. ///
  25. /// @tparam genType Floating-point or integer scalar types
  26. template<typename genType>
  27. GLM_FUNC_DECL GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon);
  28. /// Returns the component-wise comparison of |x - y| >= epsilon.
  29. /// True if this expression is not satisfied.
  30. ///
  31. /// @tparam genType Floating-point or integer scalar types
  32. template<typename genType>
  33. GLM_FUNC_DECL GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon);
  34. /// Returns the component-wise comparison between two scalars in term of ULPs.
  35. /// True if this expression is satisfied.
  36. ///
  37. /// @param x First operand.
  38. /// @param y Second operand.
  39. /// @param ULPs Maximum difference in ULPs between the two operators to consider them equal.
  40. ///
  41. /// @tparam genType Floating-point or integer scalar types
  42. template<typename genType>
  43. GLM_FUNC_DECL GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int ULPs);
  44. /// Returns the component-wise comparison between two scalars in term of ULPs.
  45. /// True if this expression is not satisfied.
  46. ///
  47. /// @param x First operand.
  48. /// @param y Second operand.
  49. /// @param ULPs Maximum difference in ULPs between the two operators to consider them not equal.
  50. ///
  51. /// @tparam genType Floating-point or integer scalar types
  52. template<typename genType>
  53. GLM_FUNC_DECL GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs);
  54. /// @}
  55. }//namespace glm
  56. #include "scalar_relational.inl"