associated_min_max.hpp 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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. #ifndef GLM_ENABLE_EXPERIMENTAL
  17. # error "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."
  18. #endif
  19. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  20. # pragma message("GLM: GLM_GTX_associated_min_max extension included")
  21. #endif
  22. namespace glm
  23. {
  24. /// @addtogroup gtx_associated_min_max
  25. /// @{
  26. /// Minimum comparison between 2 variables and returns 2 associated variable values
  27. /// @see gtx_associated_min_max
  28. template<typename T, typename U, qualifier Q>
  29. GLM_FUNC_DECL U associatedMin(T x, U a, T y, U b);
  30. /// Minimum comparison between 2 variables and returns 2 associated variable values
  31. /// @see gtx_associated_min_max
  32. template<length_t L, typename T, typename U, qualifier Q>
  33. GLM_FUNC_DECL vec<2, U, Q> associatedMin(
  34. vec<L, T, Q> const& x, vec<L, U, Q> const& a,
  35. vec<L, T, Q> const& y, vec<L, U, Q> const& b);
  36. /// Minimum comparison between 2 variables and returns 2 associated variable values
  37. /// @see gtx_associated_min_max
  38. template<length_t L, typename T, typename U, qualifier Q>
  39. GLM_FUNC_DECL vec<L, U, Q> associatedMin(
  40. T x, const vec<L, U, Q>& a,
  41. T y, const vec<L, U, Q>& b);
  42. /// Minimum comparison between 2 variables and returns 2 associated variable values
  43. /// @see gtx_associated_min_max
  44. template<length_t L, typename T, typename U, qualifier Q>
  45. GLM_FUNC_DECL vec<L, U, Q> associatedMin(
  46. vec<L, T, Q> const& x, U a,
  47. vec<L, T, Q> const& y, U b);
  48. /// Minimum comparison between 3 variables and returns 3 associated variable values
  49. /// @see gtx_associated_min_max
  50. template<typename T, typename U>
  51. GLM_FUNC_DECL U associatedMin(
  52. T x, U a,
  53. T y, U b,
  54. T z, U c);
  55. /// Minimum comparison between 3 variables and returns 3 associated variable values
  56. /// @see gtx_associated_min_max
  57. template<length_t L, typename T, typename U, qualifier Q>
  58. GLM_FUNC_DECL vec<L, U, Q> associatedMin(
  59. vec<L, T, Q> const& x, vec<L, U, Q> const& a,
  60. vec<L, T, Q> const& y, vec<L, U, Q> const& b,
  61. vec<L, T, Q> const& z, vec<L, U, Q> const& c);
  62. /// Minimum comparison between 4 variables and returns 4 associated variable values
  63. /// @see gtx_associated_min_max
  64. template<typename T, typename U>
  65. GLM_FUNC_DECL U associatedMin(
  66. T x, U a,
  67. T y, U b,
  68. T z, U c,
  69. T w, U d);
  70. /// Minimum comparison between 4 variables and returns 4 associated variable values
  71. /// @see gtx_associated_min_max
  72. template<length_t L, typename T, typename U, qualifier Q>
  73. GLM_FUNC_DECL vec<L, U, Q> associatedMin(
  74. vec<L, T, Q> const& x, vec<L, U, Q> const& a,
  75. vec<L, T, Q> const& y, vec<L, U, Q> const& b,
  76. vec<L, T, Q> const& z, vec<L, U, Q> const& c,
  77. vec<L, T, Q> const& w, vec<L, U, Q> const& d);
  78. /// Minimum comparison between 4 variables and returns 4 associated variable values
  79. /// @see gtx_associated_min_max
  80. template<length_t L, typename T, typename U, qualifier Q>
  81. GLM_FUNC_DECL vec<L, U, Q> associatedMin(
  82. T x, vec<L, U, Q> const& a,
  83. T y, vec<L, U, Q> const& b,
  84. T z, vec<L, U, Q> const& c,
  85. T w, vec<L, U, Q> const& d);
  86. /// Minimum comparison between 4 variables and returns 4 associated variable values
  87. /// @see gtx_associated_min_max
  88. template<length_t L, typename T, typename U, qualifier Q>
  89. GLM_FUNC_DECL vec<L, U, Q> associatedMin(
  90. vec<L, T, Q> const& x, U a,
  91. vec<L, T, Q> const& y, U b,
  92. vec<L, T, Q> const& z, U c,
  93. vec<L, T, Q> const& w, U d);
  94. /// Maximum comparison between 2 variables and returns 2 associated variable values
  95. /// @see gtx_associated_min_max
  96. template<typename T, typename U>
  97. GLM_FUNC_DECL U associatedMax(T x, U a, T y, U b);
  98. /// Maximum comparison between 2 variables and returns 2 associated variable values
  99. /// @see gtx_associated_min_max
  100. template<length_t L, typename T, typename U, qualifier Q>
  101. GLM_FUNC_DECL vec<2, U, Q> associatedMax(
  102. vec<L, T, Q> const& x, vec<L, U, Q> const& a,
  103. vec<L, T, Q> const& y, vec<L, U, Q> const& b);
  104. /// Maximum comparison between 2 variables and returns 2 associated variable values
  105. /// @see gtx_associated_min_max
  106. template<length_t L, typename T, typename U, qualifier Q>
  107. GLM_FUNC_DECL vec<L, T, Q> associatedMax(
  108. T x, vec<L, U, Q> const& a,
  109. T y, vec<L, U, Q> const& b);
  110. /// Maximum comparison between 2 variables and returns 2 associated variable values
  111. /// @see gtx_associated_min_max
  112. template<length_t L, typename T, typename U, qualifier Q>
  113. GLM_FUNC_DECL vec<L, U, Q> associatedMax(
  114. vec<L, T, Q> const& x, U a,
  115. vec<L, T, Q> const& y, U b);
  116. /// Maximum comparison between 3 variables and returns 3 associated variable values
  117. /// @see gtx_associated_min_max
  118. template<typename T, typename U>
  119. GLM_FUNC_DECL U associatedMax(
  120. T x, U a,
  121. T y, U b,
  122. T z, U c);
  123. /// Maximum comparison between 3 variables and returns 3 associated variable values
  124. /// @see gtx_associated_min_max
  125. template<length_t L, typename T, typename U, qualifier Q>
  126. GLM_FUNC_DECL vec<L, U, Q> associatedMax(
  127. vec<L, T, Q> const& x, vec<L, U, Q> const& a,
  128. vec<L, T, Q> const& y, vec<L, U, Q> const& b,
  129. vec<L, T, Q> const& z, vec<L, U, Q> const& c);
  130. /// Maximum comparison between 3 variables and returns 3 associated variable values
  131. /// @see gtx_associated_min_max
  132. template<length_t L, typename T, typename U, qualifier Q>
  133. GLM_FUNC_DECL vec<L, T, Q> associatedMax(
  134. T x, vec<L, U, Q> const& a,
  135. T y, vec<L, U, Q> const& b,
  136. T z, vec<L, U, Q> const& c);
  137. /// Maximum comparison between 3 variables and returns 3 associated variable values
  138. /// @see gtx_associated_min_max
  139. template<length_t L, typename T, typename U, qualifier Q>
  140. GLM_FUNC_DECL vec<L, U, Q> associatedMax(
  141. vec<L, T, Q> const& x, U a,
  142. vec<L, T, Q> const& y, U b,
  143. vec<L, T, Q> const& z, U c);
  144. /// Maximum comparison between 4 variables and returns 4 associated variable values
  145. /// @see gtx_associated_min_max
  146. template<typename T, typename U>
  147. GLM_FUNC_DECL U associatedMax(
  148. T x, U a,
  149. T y, U b,
  150. T z, U c,
  151. T w, U d);
  152. /// Maximum comparison between 4 variables and returns 4 associated variable values
  153. /// @see gtx_associated_min_max
  154. template<length_t L, typename T, typename U, qualifier Q>
  155. GLM_FUNC_DECL vec<L, U, Q> associatedMax(
  156. vec<L, T, Q> const& x, vec<L, U, Q> const& a,
  157. vec<L, T, Q> const& y, vec<L, U, Q> const& b,
  158. vec<L, T, Q> const& z, vec<L, U, Q> const& c,
  159. vec<L, T, Q> const& w, vec<L, U, Q> const& d);
  160. /// Maximum comparison between 4 variables and returns 4 associated variable values
  161. /// @see gtx_associated_min_max
  162. template<length_t L, typename T, typename U, qualifier Q>
  163. GLM_FUNC_DECL vec<L, U, Q> associatedMax(
  164. T x, vec<L, U, Q> const& a,
  165. T y, vec<L, U, Q> const& b,
  166. T z, vec<L, U, Q> const& c,
  167. T w, vec<L, U, Q> const& d);
  168. /// Maximum comparison between 4 variables and returns 4 associated variable values
  169. /// @see gtx_associated_min_max
  170. template<length_t L, typename T, typename U, qualifier Q>
  171. GLM_FUNC_DECL vec<L, U, Q> associatedMax(
  172. vec<L, T, Q> const& x, U a,
  173. vec<L, T, Q> const& y, U b,
  174. vec<L, T, Q> const& z, U c,
  175. vec<L, T, Q> const& w, U d);
  176. /// @}
  177. } //namespace glm
  178. #include "associated_min_max.inl"