You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

178 lines
3.2 KiB

  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2007-03-14
  5. // Updated : 2010-02-19
  6. // Licence : This source is under MIT License
  7. // File : gtx_extented_min_max.inl
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. namespace glm
  10. {
  11. template <typename T>
  12. GLM_FUNC_QUALIFIER T min(
  13. T const & x,
  14. T const & y,
  15. T const & z)
  16. {
  17. return glm::min(glm::min(x, y), z);
  18. }
  19. template
  20. <
  21. typename T,
  22. template <typename> class C
  23. >
  24. GLM_FUNC_QUALIFIER C<T> min
  25. (
  26. C<T> const & x,
  27. typename C<T>::value_type const & y,
  28. typename C<T>::value_type const & z
  29. )
  30. {
  31. return glm::min(glm::min(x, y), z);
  32. }
  33. template
  34. <
  35. typename T,
  36. template <typename> class C
  37. >
  38. GLM_FUNC_QUALIFIER C<T> min
  39. (
  40. C<T> const & x,
  41. C<T> const & y,
  42. C<T> const & z
  43. )
  44. {
  45. return glm::min(glm::min(x, y), z);
  46. }
  47. template <typename T>
  48. GLM_FUNC_QUALIFIER T min
  49. (
  50. T const & x,
  51. T const & y,
  52. T const & z,
  53. T const & w
  54. )
  55. {
  56. return glm::min(glm::min(x, y), glm::min(z, w));
  57. }
  58. template
  59. <
  60. typename T,
  61. template <typename> class C
  62. >
  63. GLM_FUNC_QUALIFIER C<T> min
  64. (
  65. C<T> const & x,
  66. typename C<T>::value_type const & y,
  67. typename C<T>::value_type const & z,
  68. typename C<T>::value_type const & w
  69. )
  70. {
  71. return glm::min(glm::min(x, y), glm::min(z, w));
  72. }
  73. template
  74. <
  75. typename T,
  76. template <typename> class C
  77. >
  78. GLM_FUNC_QUALIFIER C<T> min
  79. (
  80. C<T> const & x,
  81. C<T> const & y,
  82. C<T> const & z,
  83. C<T> const & w
  84. )
  85. {
  86. return glm::min(glm::min(x, y), glm::min(z, w));
  87. }
  88. template <typename T>
  89. GLM_FUNC_QUALIFIER T max(
  90. T const & x,
  91. T const & y,
  92. T const & z)
  93. {
  94. return glm::max(glm::max(x, y), z);
  95. }
  96. template
  97. <
  98. typename T,
  99. template <typename> class C
  100. >
  101. GLM_FUNC_QUALIFIER C<T> max
  102. (
  103. C<T> const & x,
  104. typename C<T>::value_type const & y,
  105. typename C<T>::value_type const & z
  106. )
  107. {
  108. return glm::max(glm::max(x, y), z);
  109. }
  110. template
  111. <
  112. typename T,
  113. template <typename> class C
  114. >
  115. GLM_FUNC_QUALIFIER C<T> max
  116. (
  117. C<T> const & x,
  118. C<T> const & y,
  119. C<T> const & z
  120. )
  121. {
  122. return glm::max(glm::max(x, y), z);
  123. }
  124. template <typename T>
  125. GLM_FUNC_QUALIFIER T max
  126. (
  127. T const & x,
  128. T const & y,
  129. T const & z,
  130. T const & w
  131. )
  132. {
  133. return glm::max(glm::max(x, y), glm::max(z, w));
  134. }
  135. template
  136. <
  137. typename T,
  138. template <typename> class C
  139. >
  140. GLM_FUNC_QUALIFIER C<T> max
  141. (
  142. C<T> const & x,
  143. typename C<T>::value_type const & y,
  144. typename C<T>::value_type const & z,
  145. typename C<T>::value_type const & w
  146. )
  147. {
  148. return glm::max(glm::max(x, y), glm::max(z, w));
  149. }
  150. template
  151. <
  152. typename T,
  153. template <typename> class C
  154. >
  155. GLM_FUNC_QUALIFIER C<T> max
  156. (
  157. C<T> const & x,
  158. C<T> const & y,
  159. C<T> const & z,
  160. C<T> const & w
  161. )
  162. {
  163. return glm::max(glm::max(x, y), glm::max(z, w));
  164. }
  165. }//namespace glm