vector_relational.hpp 4.4 KB

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