| 1 | /// @ref ext_vector_common |
| 2 | /// @file glm/ext/vector_common.hpp |
| 3 | /// |
| 4 | /// @defgroup ext_vector_common GLM_EXT_vector_common |
| 5 | /// @ingroup ext |
| 6 | /// |
| 7 | /// Exposes min and max functions for 3 to 4 vector parameters. |
| 8 | /// |
| 9 | /// Include <glm/ext/vector_common.hpp> to use the features of this extension. |
| 10 | /// |
| 11 | /// @see core_common |
| 12 | /// @see ext_scalar_common |
| 13 | |
| 14 | #pragma once |
| 15 | |
| 16 | // Dependency: |
| 17 | #include "../ext/scalar_common.hpp" |
| 18 | #include "../common.hpp" |
| 19 | |
| 20 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) |
| 21 | # pragma message("GLM: GLM_EXT_vector_common extension included") |
| 22 | #endif |
| 23 | |
| 24 | namespace glm |
| 25 | { |
| 26 | /// @addtogroup ext_vector_common |
| 27 | /// @{ |
| 28 | |
| 29 | /// Return the minimum component-wise values of 3 inputs |
| 30 | /// |
| 31 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector |
| 32 | /// @tparam T Floating-point or integer scalar types |
| 33 | /// @tparam Q Value from qualifier enum |
| 34 | template<length_t L, typename T, qualifier Q> |
| 35 | GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& a, vec<L, T, Q> const& b, vec<L, T, Q> const& c); |
| 36 | |
| 37 | /// Return the minimum component-wise values of 4 inputs |
| 38 | /// |
| 39 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector |
| 40 | /// @tparam T Floating-point or integer scalar types |
| 41 | /// @tparam Q Value from qualifier enum |
| 42 | template<length_t L, typename T, qualifier Q> |
| 43 | GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& a, vec<L, T, Q> const& b, vec<L, T, Q> const& c, vec<L, T, Q> const& d); |
| 44 | |
| 45 | /// Return the maximum component-wise values of 3 inputs |
| 46 | /// |
| 47 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector |
| 48 | /// @tparam T Floating-point or integer scalar types |
| 49 | /// @tparam Q Value from qualifier enum |
| 50 | template<length_t L, typename T, qualifier Q> |
| 51 | GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> max(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& z); |
| 52 | |
| 53 | /// Return the maximum component-wise values of 4 inputs |
| 54 | /// |
| 55 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector |
| 56 | /// @tparam T Floating-point or integer scalar types |
| 57 | /// @tparam Q Value from qualifier enum |
| 58 | template<length_t L, typename T, qualifier Q> |
| 59 | GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> max( vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& z, vec<L, T, Q> const& w); |
| 60 | |
| 61 | /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. |
| 62 | /// |
| 63 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector |
| 64 | /// @tparam T Floating-point scalar types |
| 65 | /// @tparam Q Value from qualifier enum |
| 66 | /// |
| 67 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a> |
| 68 | template<length_t L, typename T, qualifier Q> |
| 69 | GLM_FUNC_DECL vec<L, T, Q> fmin(vec<L, T, Q> const& x, T y); |
| 70 | |
| 71 | /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. |
| 72 | /// |
| 73 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector |
| 74 | /// @tparam T Floating-point scalar types |
| 75 | /// @tparam Q Value from qualifier enum |
| 76 | /// |
| 77 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a> |
| 78 | template<length_t L, typename T, qualifier Q> |
| 79 | GLM_FUNC_DECL vec<L, T, Q> fmin(vec<L, T, Q> const& x, vec<L, T, Q> const& y); |
| 80 | |
| 81 | /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. |
| 82 | /// |
| 83 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector |
| 84 | /// @tparam T Floating-point scalar types |
| 85 | /// @tparam Q Value from qualifier enum |
| 86 | /// |
| 87 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a> |
| 88 | template<length_t L, typename T, qualifier Q> |
| 89 | GLM_FUNC_DECL vec<L, T, Q> fmin(vec<L, T, Q> const& a, vec<L, T, Q> const& b, vec<L, T, Q> const& c); |
| 90 | |
| 91 | /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. |
| 92 | /// |
| 93 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector |
| 94 | /// @tparam T Floating-point scalar types |
| 95 | /// @tparam Q Value from qualifier enum |
| 96 | /// |
| 97 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a> |
| 98 | template<length_t L, typename T, qualifier Q> |
| 99 | GLM_FUNC_DECL vec<L, T, Q> fmin(vec<L, T, Q> const& a, vec<L, T, Q> const& b, vec<L, T, Q> const& c, vec<L, T, Q> const& d); |
| 100 | |
| 101 | /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. |
| 102 | /// |
| 103 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector |
| 104 | /// @tparam T Floating-point scalar types |
| 105 | /// @tparam Q Value from qualifier enum |
| 106 | /// |
| 107 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a> |
| 108 | template<length_t L, typename T, qualifier Q> |
| 109 | GLM_FUNC_DECL vec<L, T, Q> fmax(vec<L, T, Q> const& a, T b); |
| 110 | |
| 111 | /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. |
| 112 | /// |
| 113 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector |
| 114 | /// @tparam T Floating-point scalar types |
| 115 | /// @tparam Q Value from qualifier enum |
| 116 | /// |
| 117 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a> |
| 118 | template<length_t L, typename T, qualifier Q> |
| 119 | GLM_FUNC_DECL vec<L, T, Q> fmax(vec<L, T, Q> const& a, vec<L, T, Q> const& b); |
| 120 | |
| 121 | /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. |
| 122 | /// |
| 123 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector |
| 124 | /// @tparam T Floating-point scalar types |
| 125 | /// @tparam Q Value from qualifier enum |
| 126 | /// |
| 127 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a> |
| 128 | template<length_t L, typename T, qualifier Q> |
| 129 | GLM_FUNC_DECL vec<L, T, Q> fmax(vec<L, T, Q> const& a, vec<L, T, Q> const& b, vec<L, T, Q> const& c); |
| 130 | |
| 131 | /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. |
| 132 | /// |
| 133 | /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector |
| 134 | /// @tparam T Floating-point scalar types |
| 135 | /// @tparam Q Value from qualifier enum |
| 136 | /// |
| 137 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a> |
| 138 | template<length_t L, typename T, qualifier Q> |
| 139 | GLM_FUNC_DECL vec<L, T, Q> fmax(vec<L, T, Q> const& a, vec<L, T, Q> const& b, vec<L, T, Q> const& c, vec<L, T, Q> const& d); |
| 140 | |
| 141 | /// @} |
| 142 | }//namespace glm |
| 143 | |
| 144 | #include "vector_common.inl" |