14 template<length_t L,
typename R,
typename T, qualifier Q>
17 template<
typename R,
typename T, qualifier Q>
18 struct functor1<1, R, T, Q>
20 GLM_FUNC_QUALIFIER
static vec<1, R, Q> call(R (*Func) (T x), vec<1, T, Q>
const& v)
22 return vec<1, R, Q>(Func(v.x));
26 template<
typename R,
typename T, qualifier Q>
27 struct functor1<2, R, T, Q>
29 GLM_FUNC_QUALIFIER
static vec<2, R, Q> call(R (*Func) (T x), vec<2, T, Q>
const& v)
31 return vec<2, R, Q>(Func(v.x), Func(v.y));
35 template<
typename R,
typename T, qualifier Q>
36 struct functor1<3, R, T, Q>
38 GLM_FUNC_QUALIFIER
static vec<3, R, Q> call(R (*Func) (T x), vec<3, T, Q>
const& v)
40 return vec<3, R, Q>(Func(v.x), Func(v.y), Func(v.z));
44 template<
typename R,
typename T, qualifier Q>
45 struct functor1<4, R, T, Q>
47 GLM_FUNC_QUALIFIER
static vec<4, R, Q> call(R (*Func) (T x), vec<4, T, Q>
const& v)
49 return vec<4, R, Q>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
53 template<length_t L,
typename T, qualifier Q>
56 template<
typename T, qualifier Q>
57 struct functor2<1, T, Q>
59 GLM_FUNC_QUALIFIER
static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q>
const& a, vec<1, T, Q>
const& b)
61 return vec<1, T, Q>(Func(a.x, b.x));
65 template<
typename T, qualifier Q>
66 struct functor2<2, T, Q>
68 GLM_FUNC_QUALIFIER
static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q>
const& a, vec<2, T, Q>
const& b)
70 return vec<2, T, Q>(Func(a.x, b.x), Func(a.y, b.y));
74 template<
typename T, qualifier Q>
75 struct functor2<3, T, Q>
77 GLM_FUNC_QUALIFIER
static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q>
const& a, vec<3, T, Q>
const& b)
79 return vec<3, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
83 template<
typename T, qualifier Q>
84 struct functor2<4, T, Q>
86 GLM_FUNC_QUALIFIER
static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q>
const& a, vec<4, T, Q>
const& b)
88 return vec<4, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
92 template<length_t L,
typename T, qualifier Q>
93 struct functor2_vec_sca{};
95 template<
typename T, qualifier Q>
96 struct functor2_vec_sca<1, T, Q>
98 GLM_FUNC_QUALIFIER
static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q>
const& a, T b)
100 return vec<1, T, Q>(Func(a.x, b));
104 template<
typename T, qualifier Q>
105 struct functor2_vec_sca<2, T, Q>
107 GLM_FUNC_QUALIFIER
static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q>
const& a, T b)
109 return vec<2, T, Q>(Func(a.x, b), Func(a.y, b));
113 template<
typename T, qualifier Q>
114 struct functor2_vec_sca<3, T, Q>
116 GLM_FUNC_QUALIFIER
static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q>
const& a, T b)
118 return vec<3, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
122 template<
typename T, qualifier Q>
123 struct functor2_vec_sca<4, T, Q>
125 GLM_FUNC_QUALIFIER
static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q>
const& a, T b)
127 return vec<4, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b));