8 template<length_t L,
typename T,
typename floatType, qualifier Q,
bool isInteger,
bool signedType>
12 template<length_t L,
typename T,
typename floatType, qualifier Q>
17 floatType
const Min =
static_cast<floatType
>(std::numeric_limits<T>::min());
18 floatType
const Max =
static_cast<floatType
>(std::numeric_limits<T>::max());
19 return (
vec<L, floatType, Q>(v) - Min) / (Max - Min) *
static_cast<floatType
>(2) -
static_cast<floatType
>(1);
23 template<length_t L,
typename T,
typename floatType, qualifier Q>
32 template<length_t L,
typename T,
typename floatType, qualifier Q>
41 template<length_t L,
typename T,
typename floatType, qualifier Q,
bool isInteger,
bool signedType>
45 template<length_t L,
typename T,
typename floatType, qualifier Q>
50 floatType
const Max =
static_cast<floatType
>(std::numeric_limits<T>::max()) +
static_cast<floatType
>(0.5);
52 vec<L, T, Q> const Result(Scaled -
static_cast<floatType
>(0.5));
57 template<length_t L,
typename T,
typename floatType, qualifier Q>
66 template<length_t L,
typename T,
typename floatType, qualifier Q>
76 template<
typename floatType, length_t L,
typename T, qualifier Q>
79 GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559,
"'compNormalize' accepts only floating-point types for 'floatType' template parameter");
84 template<
typename T, length_t L,
typename floatType, qualifier Q>
87 GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559,
"'compScale' accepts only floating-point types for 'floatType' template parameter");
92 template<length_t L,
typename T, qualifier Q>
93 GLM_FUNC_QUALIFIER T
compAdd(vec<L, T, Q>
const& v)
96 for(length_t i = 0, n = v.length(); i < n; ++i)
101 template<length_t L,
typename T, qualifier Q>
102 GLM_FUNC_QUALIFIER T
compMul(vec<L, T, Q>
const& v)
105 for(length_t i = 0, n = v.length(); i < n; ++i)
110 template<length_t L,
typename T, qualifier Q>
111 GLM_FUNC_QUALIFIER T
compMin(vec<L, T, Q>
const& v)
114 for(length_t i = 1, n = v.length(); i < n; ++i)
115 Result =
min(Result, v[i]);
119 template<length_t L,
typename T, qualifier Q>
120 GLM_FUNC_QUALIFIER T
compMax(vec<L, T, Q>
const& v)
123 for(length_t i = 1, n = v.length(); i < n; ++i)
124 Result =
max(Result, v[i]);
GLM_FUNC_DECL GLM_CONSTEXPR genType min(genType x, genType y)
Definition func_common.inl:17
GLM_FUNC_DECL GLM_CONSTEXPR genType max(genType x, genType y)
Definition func_common.inl:25
GLM_FUNC_DECL vec< L, floatType, Q > compNormalize(vec< L, T, Q > const &v)
Definition component_wise.inl:77
GLM_FUNC_DECL vec< L, T, Q > compScale(vec< L, floatType, Q > const &v)
Definition component_wise.inl:85
GLM_FUNC_DECL genType::value_type compMin(genType const &v)
GLM_FUNC_DECL genType::value_type compMax(genType const &v)
GLM_FUNC_DECL genType::value_type compMul(genType const &v)
GLM_FUNC_DECL genType::value_type compAdd(genType const &v)
detail namespace with internal helper functions
Definition json.h:249
Core features
Definition common.hpp:21
Definition component_wise.inl:10
Definition component_wise.inl:43
Definition qualifier.hpp:35