|
|
|
@ -123,44 +123,68 @@ namespace detail |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template<length_t I, length_t N, relational_type R> |
|
|
|
|
struct reduce_relational |
|
|
|
|
struct loop_relational |
|
|
|
|
{ |
|
|
|
|
template<typename vecType> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static void call(bool& Dst, vecType const& Src) |
|
|
|
|
template<typename vecBType, typename vecType> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static void call(vecBType& Dst, vecType const& Src0, vecType const& Src1) |
|
|
|
|
{ |
|
|
|
|
Dst = relational<R>::call(Dst, Src[I]); |
|
|
|
|
reduce_relational<I + 1, N, R>::call(Dst, Src); |
|
|
|
|
Dst[I] = relational<R>::call(Src0[I], Src1[I]); |
|
|
|
|
loop_relational<I + 1, N, R>::call(Dst, Src0, Src1); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template <length_t N, relational_type R> |
|
|
|
|
struct reduce_relational<N, N, R> |
|
|
|
|
struct loop_relational<N, N, R> |
|
|
|
|
{ |
|
|
|
|
template<typename vecType> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static void call(bool&, vecType const&) |
|
|
|
|
template<typename vecBType, typename vecType> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static void call(vecBType&, vecType const&, vecType const&) |
|
|
|
|
{} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template<length_t I, length_t N, relational_type R> |
|
|
|
|
struct loop_relational |
|
|
|
|
struct reduce_relational |
|
|
|
|
{ |
|
|
|
|
template<typename vecBType, typename vecType> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static void call(vecBType& Dst, vecType const& Src0, vecType const& Src1) |
|
|
|
|
template<typename vecType> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static void call(bool& Dst, vecType const& Src) |
|
|
|
|
{ |
|
|
|
|
Dst[I] = relational<R>::call(Src0[I], Src1[I]); |
|
|
|
|
loop_relational<I + 1, N, R>::call(Dst, Src0, Src1); |
|
|
|
|
Dst = relational<R>::call(Dst, Src[I]); |
|
|
|
|
reduce_relational<I + 1, N, R>::call(Dst, Src); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template <length_t N, relational_type R> |
|
|
|
|
struct loop_relational<N, N, R> |
|
|
|
|
struct reduce_relational<N, N, R> |
|
|
|
|
{ |
|
|
|
|
template<typename vecBType, typename vecType> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static void call(vecBType&, vecType const&, vecType const&) |
|
|
|
|
template<typename vecType> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static void call(bool&, vecType const&) |
|
|
|
|
{} |
|
|
|
|
}; |
|
|
|
|
}//namespace detail |
|
|
|
|
|
|
|
|
|
template<length_t L, qualifier Q> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool any(vec<L, bool, Q> const& v) |
|
|
|
|
{ |
|
|
|
|
bool Result = false; |
|
|
|
|
detail::reduce_relational<0, L, detail::ANY>::call(Result, v); |
|
|
|
|
return Result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template<length_t L, qualifier Q> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool all(vec<L, bool, Q> const& v) |
|
|
|
|
{ |
|
|
|
|
bool Result = true; |
|
|
|
|
detail::reduce_relational<0, L, detail::ALL>::call(Result, v); |
|
|
|
|
return Result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template<length_t L, qualifier Q> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, bool, Q> not_(vec<L, bool, Q> const& v) |
|
|
|
|
{ |
|
|
|
|
vec<L, bool, Q> Result; |
|
|
|
|
detail::loop_relational<0, L, detail::NOT>::call(Result, v, v); |
|
|
|
|
return Result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template<length_t L, typename T, qualifier Q> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, bool, Q> lessThan(vec<L, T, Q> const& x, vec<L, T, Q> const& y) |
|
|
|
|
{ |
|
|
|
@ -208,30 +232,6 @@ namespace detail |
|
|
|
|
detail::loop_relational<0, L, detail::NOT_EQUAL>::call(Result, x, y); |
|
|
|
|
return Result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template<length_t L, qualifier Q> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool any(vec<L, bool, Q> const& v) |
|
|
|
|
{ |
|
|
|
|
bool Result = false; |
|
|
|
|
detail::reduce_relational<0, L, detail::ANY>::call(Result, v); |
|
|
|
|
return Result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template<length_t L, qualifier Q> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool all(vec<L, bool, Q> const& v) |
|
|
|
|
{ |
|
|
|
|
bool Result = true; |
|
|
|
|
detail::reduce_relational<0, L, detail::ALL>::call(Result, v); |
|
|
|
|
return Result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
template<length_t L, qualifier Q> |
|
|
|
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, bool, Q> not_(vec<L, bool, Q> const& v) |
|
|
|
|
{ |
|
|
|
|
vec<L, bool, Q> Result; |
|
|
|
|
detail::loop_relational<0, L, detail::NOT>::call(Result, v, v); |
|
|
|
|
return Result; |
|
|
|
|
} |
|
|
|
|
}//namespace glm |
|
|
|
|
|
|
|
|
|
#if GLM_CONFIG_SIMD == GLM_ENABLE |
|
|
|
|