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 /// @brief Min and max functions that return associated values not the compared onces. 11 /// <glm/gtx/associated_min_max.hpp> need to be included to use these functionalities. 12 13 #pragma once 14 15 // Dependency: 16 #include "../glm.hpp" 17 18 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 # pragma message("GLM: GLM_GTX_associated_min_max extension included") 20 #endif 21 22 namespace glm 23 { 24 /// @addtogroup gtx_associated_min_max 25 /// @{ 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, precision P> 30 GLM_FUNC_DECL U associatedMin(T x, U a, T y, U b); 31 32 /// Minimum comparison between 2 variables and returns 2 associated variable values 33 /// @see gtx_associated_min_max 34 template<typename T, typename U, precision P, template <typename, precision> class vecType> 35 GLM_FUNC_DECL tvec2<U, P> associatedMin( 36 vecType<T, P> const & x, vecType<U, P> const & a, 37 vecType<T, P> const & y, vecType<U, P> const & b); 38 39 /// Minimum comparison between 2 variables and returns 2 associated variable values 40 /// @see gtx_associated_min_max 41 template<typename T, typename U, precision P, template <typename, precision> class vecType> 42 GLM_FUNC_DECL vecType<U, P> associatedMin( 43 T x, const vecType<U, P>& a, 44 T y, const vecType<U, P>& b); 45 46 /// Minimum comparison between 2 variables and returns 2 associated variable values 47 /// @see gtx_associated_min_max 48 template<typename T, typename U, precision P, template <typename, precision> class vecType> 49 GLM_FUNC_DECL vecType<U, P> associatedMin( 50 vecType<T, P> const & x, U a, 51 vecType<T, P> const & y, U b); 52 53 /// Minimum comparison between 3 variables and returns 3 associated variable values 54 /// @see gtx_associated_min_max 55 template<typename T, typename U> 56 GLM_FUNC_DECL U associatedMin( 57 T x, U a, 58 T y, U b, 59 T z, U c); 60 61 /// Minimum comparison between 3 variables and returns 3 associated variable values 62 /// @see gtx_associated_min_max 63 template<typename T, typename U, precision P, template <typename, precision> class vecType> 64 GLM_FUNC_DECL vecType<U, P> associatedMin( 65 vecType<T, P> const & x, vecType<U, P> const & a, 66 vecType<T, P> const & y, vecType<U, P> const & b, 67 vecType<T, P> const & z, vecType<U, P> const & c); 68 69 /// Minimum comparison between 4 variables and returns 4 associated variable values 70 /// @see gtx_associated_min_max 71 template<typename T, typename U> 72 GLM_FUNC_DECL U associatedMin( 73 T x, U a, 74 T y, U b, 75 T z, U c, 76 T w, U d); 77 78 /// Minimum comparison between 4 variables and returns 4 associated variable values 79 /// @see gtx_associated_min_max 80 template<typename T, typename U, precision P, template <typename, precision> class vecType> 81 GLM_FUNC_DECL vecType<U, P> associatedMin( 82 vecType<T, P> const & x, vecType<U, P> const & a, 83 vecType<T, P> const & y, vecType<U, P> const & b, 84 vecType<T, P> const & z, vecType<U, P> const & c, 85 vecType<T, P> const & w, vecType<U, P> const & d); 86 87 /// Minimum comparison between 4 variables and returns 4 associated variable values 88 /// @see gtx_associated_min_max 89 template<typename T, typename U, precision P, template <typename, precision> class vecType> 90 GLM_FUNC_DECL vecType<U, P> associatedMin( 91 T x, vecType<U, P> const & a, 92 T y, vecType<U, P> const & b, 93 T z, vecType<U, P> const & c, 94 T w, vecType<U, P> const & d); 95 96 /// Minimum comparison between 4 variables and returns 4 associated variable values 97 /// @see gtx_associated_min_max 98 template<typename T, typename U, precision P, template <typename, precision> class vecType> 99 GLM_FUNC_DECL vecType<U, P> associatedMin( 100 vecType<T, P> const & x, U a, 101 vecType<T, P> const & y, U b, 102 vecType<T, P> const & z, U c, 103 vecType<T, P> const & w, U d); 104 105 /// Maximum comparison between 2 variables and returns 2 associated variable values 106 /// @see gtx_associated_min_max 107 template<typename T, typename U> 108 GLM_FUNC_DECL U associatedMax(T x, U a, T y, U b); 109 110 /// Maximum comparison between 2 variables and returns 2 associated variable values 111 /// @see gtx_associated_min_max 112 template<typename T, typename U, precision P, template <typename, precision> class vecType> 113 GLM_FUNC_DECL tvec2<U, P> associatedMax( 114 vecType<T, P> const & x, vecType<U, P> const & a, 115 vecType<T, P> const & y, vecType<U, P> const & b); 116 117 /// Maximum comparison between 2 variables and returns 2 associated variable values 118 /// @see gtx_associated_min_max 119 template<typename T, typename U, precision P, template <typename, precision> class vecType> 120 GLM_FUNC_DECL vecType<T, P> associatedMax( 121 T x, vecType<U, P> const & a, 122 T y, vecType<U, P> const & b); 123 124 /// Maximum comparison between 2 variables and returns 2 associated variable values 125 /// @see gtx_associated_min_max 126 template<typename T, typename U, precision P, template <typename, precision> class vecType> 127 GLM_FUNC_DECL vecType<U, P> associatedMax( 128 vecType<T, P> const & x, U a, 129 vecType<T, P> const & y, U b); 130 131 /// Maximum comparison between 3 variables and returns 3 associated variable values 132 /// @see gtx_associated_min_max 133 template<typename T, typename U> 134 GLM_FUNC_DECL U associatedMax( 135 T x, U a, 136 T y, U b, 137 T z, U c); 138 139 /// Maximum comparison between 3 variables and returns 3 associated variable values 140 /// @see gtx_associated_min_max 141 template<typename T, typename U, precision P, template <typename, precision> class vecType> 142 GLM_FUNC_DECL vecType<U, P> associatedMax( 143 vecType<T, P> const & x, vecType<U, P> const & a, 144 vecType<T, P> const & y, vecType<U, P> const & b, 145 vecType<T, P> const & z, vecType<U, P> const & c); 146 147 /// Maximum comparison between 3 variables and returns 3 associated variable values 148 /// @see gtx_associated_min_max 149 template<typename T, typename U, precision P, template <typename, precision> class vecType> 150 GLM_FUNC_DECL vecType<T, P> associatedMax( 151 T x, vecType<U, P> const & a, 152 T y, vecType<U, P> const & b, 153 T z, vecType<U, P> const & c); 154 155 /// Maximum comparison between 3 variables and returns 3 associated variable values 156 /// @see gtx_associated_min_max 157 template<typename T, typename U, precision P, template <typename, precision> class vecType> 158 GLM_FUNC_DECL vecType<U, P> associatedMax( 159 vecType<T, P> const & x, U a, 160 vecType<T, P> const & y, U b, 161 vecType<T, P> const & z, U c); 162 163 /// Maximum comparison between 4 variables and returns 4 associated variable values 164 /// @see gtx_associated_min_max 165 template<typename T, typename U> 166 GLM_FUNC_DECL U associatedMax( 167 T x, U a, 168 T y, U b, 169 T z, U c, 170 T w, U d); 171 172 /// Maximum comparison between 4 variables and returns 4 associated variable values 173 /// @see gtx_associated_min_max 174 template<typename T, typename U, precision P, template <typename, precision> class vecType> 175 GLM_FUNC_DECL vecType<U, P> associatedMax( 176 vecType<T, P> const & x, vecType<U, P> const & a, 177 vecType<T, P> const & y, vecType<U, P> const & b, 178 vecType<T, P> const & z, vecType<U, P> const & c, 179 vecType<T, P> const & w, vecType<U, P> const & d); 180 181 /// Maximum comparison between 4 variables and returns 4 associated variable values 182 /// @see gtx_associated_min_max 183 template<typename T, typename U, precision P, template <typename, precision> class vecType> 184 GLM_FUNC_DECL vecType<U, P> associatedMax( 185 T x, vecType<U, P> const & a, 186 T y, vecType<U, P> const & b, 187 T z, vecType<U, P> const & c, 188 T w, vecType<U, P> const & d); 189 190 /// Maximum comparison between 4 variables and returns 4 associated variable values 191 /// @see gtx_associated_min_max 192 template<typename T, typename U, precision P, template <typename, precision> class vecType> 193 GLM_FUNC_DECL vecType<U, P> associatedMax( 194 vecType<T, P> const & x, U a, 195 vecType<T, P> const & y, U b, 196 vecType<T, P> const & z, U c, 197 vecType<T, P> const & w, U d); 198 199 /// @} 200 } //namespace glm 201 202 #include "associated_min_max.inl" 203