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.

106 lines
3.8 KiB

4 years ago
  1. ///////////////////////////////////////////////////////////////////////////////////
  2. /// OpenGL Mathematics (glm.g-truc.net)
  3. ///
  4. /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
  5. /// Permission is hereby granted, free of charge, to any person obtaining a copy
  6. /// of this software and associated documentation files (the "Software"), to deal
  7. /// in the Software without restriction, including without limitation the rights
  8. /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. /// copies of the Software, and to permit persons to whom the Software is
  10. /// furnished to do so, subject to the following conditions:
  11. ///
  12. /// The above copyright notice and this permission notice shall be included in
  13. /// all copies or substantial portions of the Software.
  14. ///
  15. /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. /// THE SOFTWARE.
  22. ///
  23. /// @ref gtx_associated_min_max
  24. /// @file glm/gtx/associated_min_max.hpp
  25. /// @date 2008-03-10 / 2011-06-07
  26. /// @author Christophe Riccio
  27. ///
  28. /// @see core (dependence)
  29. /// @see gtx_extented_min_max (dependence)
  30. ///
  31. /// @defgroup gtx_associated_min_max GLM_GTX_associated_min_max
  32. /// @ingroup gtx
  33. ///
  34. /// @brief Min and max functions that return associated values not the compared onces.
  35. /// <glm/gtx/associated_min_max.hpp> need to be included to use these functionalities.
  36. ///////////////////////////////////////////////////////////////////////////////////
  37. #ifndef GLM_GTX_associated_min_max
  38. #define GLM_GTX_associated_min_max GLM_VERSION
  39. // Dependency:
  40. #include "../glm.hpp"
  41. #if(defined(GLM_MESSAGES) && !defined(glm_ext))
  42. # pragma message("GLM: GLM_GTX_associated_min_max extension included")
  43. #endif
  44. namespace glm
  45. {
  46. /// @addtogroup gtx_associated_min_max
  47. /// @{
  48. /// Min comparison between 2 variables
  49. /// @see gtx_associated_min_max
  50. template<typename genTypeT, typename genTypeU>
  51. genTypeU associatedMin(
  52. const genTypeT& x, const genTypeU& a,
  53. const genTypeT& y, const genTypeU& b);
  54. /// Min comparison between 3 variables
  55. /// @see gtx_associated_min_max
  56. template<typename genTypeT, typename genTypeU>
  57. genTypeU associatedMin(
  58. const genTypeT& x, const genTypeU& a,
  59. const genTypeT& y, const genTypeU& b,
  60. const genTypeT& z, const genTypeU& c);
  61. /// Min comparison between 4 variables
  62. /// @see gtx_associated_min_max
  63. template<typename genTypeT, typename genTypeU>
  64. genTypeU associatedMin(
  65. const genTypeT& x, const genTypeU& a,
  66. const genTypeT& y, const genTypeU& b,
  67. const genTypeT& z, const genTypeU& c,
  68. const genTypeT& w, const genTypeU& d);
  69. /// Max comparison between 2 variables
  70. /// @see gtx_associated_min_max
  71. template<typename genTypeT, typename genTypeU>
  72. genTypeU associatedMax(
  73. const genTypeT& x, const genTypeU& a,
  74. const genTypeT& y, const genTypeU& b);
  75. /// Max comparison between 3 variables
  76. /// @see gtx_associated_min_max
  77. template<typename genTypeT, typename genTypeU>
  78. genTypeU associatedMax(
  79. const genTypeT& x, const genTypeU& a,
  80. const genTypeT& y, const genTypeU& b,
  81. const genTypeT& z, const genTypeU& c);
  82. /// Max comparison between 4 variables
  83. /// @see gtx_associated_min_max
  84. template<typename genTypeT, typename genTypeU>
  85. genTypeU associatedMax(
  86. const genTypeT& x, const genTypeU& a,
  87. const genTypeT& y, const genTypeU& b,
  88. const genTypeT& z, const genTypeU& c,
  89. const genTypeT& w, const genTypeU& d);
  90. /// @}
  91. } //namespace glm
  92. #include "associated_min_max.inl"
  93. #endif//GLM_GTX_associated_min_max