- Added EXT_vector_relational: openBounded and closeBounded

This commit is contained in:
Christophe Riccio 2017-09-20 17:57:44 +02:00
parent 30ee2cd1bb
commit bfa6c9e192
3 changed files with 33 additions and 0 deletions

View File

@ -87,6 +87,26 @@ namespace glm
template<typename genType> template<typename genType>
GLM_FUNC_DECL bool notEqual(genType const& x, genType const& y, genType const& epsilon); GLM_FUNC_DECL bool notEqual(genType const& x, genType const& y, genType const& epsilon);
/// 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 }//namespace glm

View File

@ -43,4 +43,16 @@ namespace glm
{ {
return greaterThanEqual(abs(x - y), epsilon); return greaterThanEqual(abs(x - y), epsilon);
} }
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 }//namespace glm

View File

@ -64,6 +64,7 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate)
- Added quatLookAt to GTX_quaternion #659 - Added quatLookAt to GTX_quaternion #659
- Added fmin, fmax and fclamp to GTX_extended_min_max #372 - Added fmin, fmax and fclamp to GTX_extended_min_max #372
- Added EXT_vector_relational: extend equal and notEqual to take an epsilon argument - Added EXT_vector_relational: extend equal and notEqual to take an epsilon argument
- Added EXT_vector_relational: openBounded and closeBounded
- Added EXT_vec1: *vec1 types - Added EXT_vec1: *vec1 types
- Added GTX_texture: levels function - Added GTX_texture: levels function