From e62817b8252974b8a98393275874ee303840bf13 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Fri, 12 May 2017 18:49:50 +0500 Subject: 2017-05-12 --- .../include/glm/detail/func_vector_relational.inl | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 depedencies/include/glm/detail/func_vector_relational.inl (limited to 'depedencies/include/glm/detail/func_vector_relational.inl') diff --git a/depedencies/include/glm/detail/func_vector_relational.inl b/depedencies/include/glm/detail/func_vector_relational.inl new file mode 100644 index 0000000..3d8d2b7 --- /dev/null +++ b/depedencies/include/glm/detail/func_vector_relational.inl @@ -0,0 +1,105 @@ +/// @ref core +/// @file glm/detail/func_vector_relational.inl + +#include + +namespace glm +{ + template class vecType> + GLM_FUNC_QUALIFIER vecType lessThan(vecType const & x, vecType const & y) + { + assert(x.length() == y.length()); + + vecType Result(uninitialize); + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] < y[i]; + + return Result; + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType lessThanEqual(vecType const & x, vecType const & y) + { + assert(x.length() == y.length()); + + vecType Result(uninitialize); + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] <= y[i]; + return Result; + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType greaterThan(vecType const & x, vecType const & y) + { + assert(x.length() == y.length()); + + vecType Result(uninitialize); + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] > y[i]; + return Result; + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType greaterThanEqual(vecType const & x, vecType const & y) + { + assert(x.length() == y.length()); + + vecType Result(uninitialize); + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] >= y[i]; + return Result; + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType equal(vecType const & x, vecType const & y) + { + assert(x.length() == y.length()); + + vecType Result(uninitialize); + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] == y[i]; + return Result; + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType notEqual(vecType const & x, vecType const & y) + { + assert(x.length() == y.length()); + + vecType Result(uninitialize); + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] != y[i]; + return Result; + } + + template class vecType> + GLM_FUNC_QUALIFIER bool any(vecType const & v) + { + bool Result = false; + for(length_t i = 0; i < v.length(); ++i) + Result = Result || v[i]; + return Result; + } + + template class vecType> + GLM_FUNC_QUALIFIER bool all(vecType const & v) + { + bool Result = true; + for(length_t i = 0; i < v.length(); ++i) + Result = Result && v[i]; + return Result; + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType not_(vecType const & v) + { + vecType Result(uninitialize); + for(length_t i = 0; i < v.length(); ++i) + Result[i] = !v[i]; + return Result; + } +}//namespace glm + +#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS +# include "func_vector_relational_simd.inl" +#endif -- cgit v1.2.3