Moved bounded function to GTX_common from EXT_vector_relational as there are quite new

This commit is contained in:
Christophe Riccio
2018-05-08 13:34:22 +02:00
parent 77acd2fe40
commit 4d4dbcade6
12 changed files with 275 additions and 126 deletions

View File

@@ -50,6 +50,26 @@ namespace glm
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> fmod(vec<L, T, Q> const& v);
/// Returns whether vector components values are within an interval. A open interval excludes its endpoints, and is denoted with square brackets.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see ext_vector_relational
template <length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> openBounded(vec<L, T, Q> const& Value, vec<L, T, Q> const& Min, vec<L, T, Q> const& Max);
/// Returns whether vector components values are within an interval. A closed interval includes its endpoints, and is denoted with square brackets.
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point or integer scalar types
/// @tparam Q Value from qualifier enum
///
/// @see ext_vector_relational
template <length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> closeBounded(vec<L, T, Q> const& Value, vec<L, T, Q> const& Min, vec<L, T, Q> const& Max);
/// @}
}//namespace glm

View File

@@ -111,4 +111,16 @@ namespace detail
{
return detail::compute_fmod<L, T, Q, std::numeric_limits<T>::is_iec559>::call(x, y);
}
template <length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, bool, Q> openBounded(vec<L, T, Q> const& Value, vec<L, T, Q> const& Min, vec<L, T, Q> const& Max)
{
return greaterThan(Value, Min) && lessThan(Value, Max);
}
template <length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, bool, Q> closeBounded(vec<L, T, Q> const& Value, vec<L, T, Q> const& Min, vec<L, T, Q> const& Max)
{
return greaterThanEqual(Value, Min) && lessThanEqual(Value, Max);
}
}//namespace glm

View File

@@ -200,14 +200,17 @@ namespace glm{
template <typename genType>
GLM_FUNC_DECL genType backEaseInOut(genType const& a, genType const& o);
/// @see gtx_easing
template <typename genType>
GLM_FUNC_DECL genType bounceEaseIn(genType const& a);
/// @see gtx_easing
template <typename genType>
GLM_FUNC_DECL genType bounceEaseOut(genType const& a);
/// @see gtx_easing
template <typename genType>
GLM_FUNC_DECL genType bounceEaseInOut(genType const& a, genType);
GLM_FUNC_DECL genType bounceEaseInOut(genType const& a);
/// @}
}//namespace glm