vector_relational.hpp 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /// @ref ext_vector_relational
  2. /// @file glm/ext/vector_relational.hpp
  3. ///
  4. /// @defgroup ext_vector_relational GLM_EXT_vector_relational
  5. /// @ingroup ext
  6. ///
  7. /// Exposes comparison functions for vector types that take a user defined epsilon values.
  8. ///
  9. /// Include <glm/ext/vector_relational.hpp> to use the features of this extension.
  10. ///
  11. /// @see core_vector_relational
  12. /// @see ext_scalar_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_vector_relational extension included")
  19. #endif
  20. namespace glm
  21. {
  22. /// @addtogroup ext_vector_relational
  23. /// @{
  24. /// Returns the component-wise comparison of |x - y| < epsilon.
  25. /// True if this expression is satisfied.
  26. ///
  27. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
  28. /// @tparam T Floating-point or integer scalar types
  29. /// @tparam Q Value from qualifier enum
  30. template<length_t L, typename T, qualifier Q>
  31. GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T epsilon);
  32. /// Returns the component-wise comparison of |x - y| < epsilon.
  33. /// True if this expression is satisfied.
  34. ///
  35. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
  36. /// @tparam T Floating-point or integer scalar types
  37. /// @tparam Q Value from qualifier enum
  38. template<length_t L, typename T, qualifier Q>
  39. GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& epsilon);
  40. /// Returns the component-wise comparison of |x - y| >= epsilon.
  41. /// True if this expression is not satisfied.
  42. ///
  43. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
  44. /// @tparam T Floating-point or integer scalar types
  45. /// @tparam Q Value from qualifier enum
  46. template<length_t L, typename T, qualifier Q>
  47. GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T epsilon);
  48. /// Returns the component-wise comparison of |x - y| >= epsilon.
  49. /// True if this expression is not satisfied.
  50. ///
  51. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
  52. /// @tparam T Floating-point or integer scalar types
  53. /// @tparam Q Value from qualifier enum
  54. template<length_t L, typename T, qualifier Q>
  55. GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& epsilon);
  56. /// Returns the component-wise comparison between two vectors in term of ULPs.
  57. /// True if this expression is satisfied.
  58. ///
  59. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
  60. /// @tparam T Floating-point
  61. /// @tparam Q Value from qualifier enum
  62. template<length_t L, typename T, qualifier Q>
  63. GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y, int ULPs);
  64. /// Returns the component-wise comparison between two vectors in term of ULPs.
  65. /// True if this expression is satisfied.
  66. ///
  67. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
  68. /// @tparam T Floating-point
  69. /// @tparam Q Value from qualifier enum
  70. template<length_t L, typename T, qualifier Q>
  71. GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, int, Q> const& ULPs);
  72. /// Returns the component-wise comparison between two vectors in term of ULPs.
  73. /// True if this expression is not satisfied.
  74. ///
  75. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
  76. /// @tparam T Floating-point
  77. /// @tparam Q Value from qualifier enum
  78. template<length_t L, typename T, qualifier Q>
  79. GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, int ULPs);
  80. /// Returns the component-wise comparison between two vectors in term of ULPs.
  81. /// True if this expression is not satisfied.
  82. ///
  83. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
  84. /// @tparam T Floating-point
  85. /// @tparam Q Value from qualifier enum
  86. template<length_t L, typename T, qualifier Q>
  87. GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, int, Q> const& ULPs);
  88. /// @}
  89. }//namespace glm
  90. #include "vector_relational.inl"