associated_min_max.hpp 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. /// @ref gtx_associated_min_max
  2. /// @file glm/gtx/associated_min_max.hpp
  3. ///
  4. /// @see core (dependence)
  5. /// @see gtx_extented_min_max (dependence)
  6. ///
  7. /// @defgroup gtx_associated_min_max GLM_GTX_associated_min_max
  8. /// @ingroup gtx
  9. ///
  10. /// Include <glm/gtx/associated_min_max.hpp> to use the features of this extension.
  11. ///
  12. /// @brief Min and max functions that return associated values not the compared onces.
  13. #pragma once
  14. // Dependency:
  15. #include "../glm.hpp"
  16. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  17. # ifndef GLM_ENABLE_EXPERIMENTAL
  18. # pragma message("GLM: GLM_GTX_associated_min_max is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.")
  19. # else
  20. # pragma message("GLM: GLM_GTX_associated_min_max extension included")
  21. # endif
  22. #endif
  23. namespace glm
  24. {
  25. /// @addtogroup gtx_associated_min_max
  26. /// @{
  27. /// Minimum comparison between 2 variables and returns 2 associated variable values
  28. /// @see gtx_associated_min_max
  29. template<typename T, typename U, qualifier Q>
  30. GLM_FUNC_DECL U associatedMin(T x, U a, T y, U b);
  31. /// Minimum comparison between 2 variables and returns 2 associated variable values
  32. /// @see gtx_associated_min_max
  33. template<length_t L, typename T, typename U, qualifier Q>
  34. GLM_FUNC_DECL vec<2, U, Q> associatedMin(
  35. vec<L, T, Q> const& x, vec<L, U, Q> const& a,
  36. vec<L, T, Q> const& y, vec<L, U, Q> const& b);
  37. /// Minimum comparison between 2 variables and returns 2 associated variable values
  38. /// @see gtx_associated_min_max
  39. template<length_t L, typename T, typename U, qualifier Q>
  40. GLM_FUNC_DECL vec<L, U, Q> associatedMin(
  41. T x, const vec<L, U, Q>& a,
  42. T y, const vec<L, U, Q>& b);
  43. /// Minimum comparison between 2 variables and returns 2 associated variable values
  44. /// @see gtx_associated_min_max
  45. template<length_t L, typename T, typename U, qualifier Q>
  46. GLM_FUNC_DECL vec<L, U, Q> associatedMin(
  47. vec<L, T, Q> const& x, U a,
  48. vec<L, T, Q> const& y, U b);
  49. /// Minimum comparison between 3 variables and returns 3 associated variable values
  50. /// @see gtx_associated_min_max
  51. template<typename T, typename U>
  52. GLM_FUNC_DECL U associatedMin(
  53. T x, U a,
  54. T y, U b,
  55. T z, U c);
  56. /// Minimum comparison between 3 variables and returns 3 associated variable values
  57. /// @see gtx_associated_min_max
  58. template<length_t L, typename T, typename U, qualifier Q>
  59. GLM_FUNC_DECL vec<L, U, Q> associatedMin(
  60. vec<L, T, Q> const& x, vec<L, U, Q> const& a,
  61. vec<L, T, Q> const& y, vec<L, U, Q> const& b,
  62. vec<L, T, Q> const& z, vec<L, U, Q> const& c);
  63. /// Minimum comparison between 4 variables and returns 4 associated variable values
  64. /// @see gtx_associated_min_max
  65. template<typename T, typename U>
  66. GLM_FUNC_DECL U associatedMin(
  67. T x, U a,
  68. T y, U b,
  69. T z, U c,
  70. T w, U d);
  71. /// Minimum comparison between 4 variables and returns 4 associated variable values
  72. /// @see gtx_associated_min_max
  73. template<length_t L, typename T, typename U, qualifier Q>
  74. GLM_FUNC_DECL vec<L, U, Q> associatedMin(
  75. vec<L, T, Q> const& x, vec<L, U, Q> const& a,
  76. vec<L, T, Q> const& y, vec<L, U, Q> const& b,
  77. vec<L, T, Q> const& z, vec<L, U, Q> const& c,
  78. vec<L, T, Q> const& w, vec<L, U, Q> const& d);
  79. /// Minimum comparison between 4 variables and returns 4 associated variable values
  80. /// @see gtx_associated_min_max
  81. template<length_t L, typename T, typename U, qualifier Q>
  82. GLM_FUNC_DECL vec<L, U, Q> associatedMin(
  83. T x, vec<L, U, Q> const& a,
  84. T y, vec<L, U, Q> const& b,
  85. T z, vec<L, U, Q> const& c,
  86. T w, vec<L, U, Q> const& d);
  87. /// Minimum comparison between 4 variables and returns 4 associated variable values
  88. /// @see gtx_associated_min_max
  89. template<length_t L, typename T, typename U, qualifier Q>
  90. GLM_FUNC_DECL vec<L, U, Q> associatedMin(
  91. vec<L, T, Q> const& x, U a,
  92. vec<L, T, Q> const& y, U b,
  93. vec<L, T, Q> const& z, U c,
  94. vec<L, T, Q> const& w, U d);
  95. /// Maximum comparison between 2 variables and returns 2 associated variable values
  96. /// @see gtx_associated_min_max
  97. template<typename T, typename U>
  98. GLM_FUNC_DECL U associatedMax(T x, U a, T y, U b);
  99. /// Maximum comparison between 2 variables and returns 2 associated variable values
  100. /// @see gtx_associated_min_max
  101. template<length_t L, typename T, typename U, qualifier Q>
  102. GLM_FUNC_DECL vec<2, U, Q> associatedMax(
  103. vec<L, T, Q> const& x, vec<L, U, Q> const& a,
  104. vec<L, T, Q> const& y, vec<L, U, Q> const& b);
  105. /// Maximum comparison between 2 variables and returns 2 associated variable values
  106. /// @see gtx_associated_min_max
  107. template<length_t L, typename T, typename U, qualifier Q>
  108. GLM_FUNC_DECL vec<L, T, Q> associatedMax(
  109. T x, vec<L, U, Q> const& a,
  110. T y, vec<L, U, Q> const& b);
  111. /// Maximum comparison between 2 variables and returns 2 associated variable values
  112. /// @see gtx_associated_min_max
  113. template<length_t L, typename T, typename U, qualifier Q>
  114. GLM_FUNC_DECL vec<L, U, Q> associatedMax(
  115. vec<L, T, Q> const& x, U a,
  116. vec<L, T, Q> const& y, U b);
  117. /// Maximum comparison between 3 variables and returns 3 associated variable values
  118. /// @see gtx_associated_min_max
  119. template<typename T, typename U>
  120. GLM_FUNC_DECL U associatedMax(
  121. T x, U a,
  122. T y, U b,
  123. T z, U c);
  124. /// Maximum comparison between 3 variables and returns 3 associated variable values
  125. /// @see gtx_associated_min_max
  126. template<length_t L, typename T, typename U, qualifier Q>
  127. GLM_FUNC_DECL vec<L, U, Q> associatedMax(
  128. vec<L, T, Q> const& x, vec<L, U, Q> const& a,
  129. vec<L, T, Q> const& y, vec<L, U, Q> const& b,
  130. vec<L, T, Q> const& z, vec<L, U, Q> const& c);
  131. /// Maximum comparison between 3 variables and returns 3 associated variable values
  132. /// @see gtx_associated_min_max
  133. template<length_t L, typename T, typename U, qualifier Q>
  134. GLM_FUNC_DECL vec<L, T, Q> associatedMax(
  135. T x, vec<L, U, Q> const& a,
  136. T y, vec<L, U, Q> const& b,
  137. T z, vec<L, U, Q> const& c);
  138. /// Maximum comparison between 3 variables and returns 3 associated variable values
  139. /// @see gtx_associated_min_max
  140. template<length_t L, typename T, typename U, qualifier Q>
  141. GLM_FUNC_DECL vec<L, U, Q> associatedMax(
  142. vec<L, T, Q> const& x, U a,
  143. vec<L, T, Q> const& y, U b,
  144. vec<L, T, Q> const& z, U c);
  145. /// Maximum comparison between 4 variables and returns 4 associated variable values
  146. /// @see gtx_associated_min_max
  147. template<typename T, typename U>
  148. GLM_FUNC_DECL U associatedMax(
  149. T x, U a,
  150. T y, U b,
  151. T z, U c,
  152. T w, U d);
  153. /// Maximum comparison between 4 variables and returns 4 associated variable values
  154. /// @see gtx_associated_min_max
  155. template<length_t L, typename T, typename U, qualifier Q>
  156. GLM_FUNC_DECL vec<L, U, Q> associatedMax(
  157. vec<L, T, Q> const& x, vec<L, U, Q> const& a,
  158. vec<L, T, Q> const& y, vec<L, U, Q> const& b,
  159. vec<L, T, Q> const& z, vec<L, U, Q> const& c,
  160. vec<L, T, Q> const& w, vec<L, U, Q> const& d);
  161. /// Maximum comparison between 4 variables and returns 4 associated variable values
  162. /// @see gtx_associated_min_max
  163. template<length_t L, typename T, typename U, qualifier Q>
  164. GLM_FUNC_DECL vec<L, U, Q> associatedMax(
  165. T x, vec<L, U, Q> const& a,
  166. T y, vec<L, U, Q> const& b,
  167. T z, vec<L, U, Q> const& c,
  168. T w, vec<L, U, Q> const& d);
  169. /// Maximum comparison between 4 variables and returns 4 associated variable values
  170. /// @see gtx_associated_min_max
  171. template<length_t L, typename T, typename U, qualifier Q>
  172. GLM_FUNC_DECL vec<L, U, Q> associatedMax(
  173. vec<L, T, Q> const& x, U a,
  174. vec<L, T, Q> const& y, U b,
  175. vec<L, T, Q> const& z, U c,
  176. vec<L, T, Q> const& w, U d);
  177. /// @}
  178. } //namespace glm
  179. #include "associated_min_max.inl"