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