39 template <
typename R,
typename T, precision P,
template <
typename, precision>
class vecType>
42 template <
typename R,
typename T, precision P>
43 struct functor1<R, T, P, tvec1>
45 GLM_FUNC_QUALIFIER
static tvec1<R, P> call(R (*Func) (T x), tvec1<T, P>
const & v)
47 return tvec1<R, P>(Func(v.x));
51 template <
typename R,
typename T, precision P>
52 struct functor1<R, T, P, tvec2>
54 GLM_FUNC_QUALIFIER
static tvec2<R, P> call(R (*Func) (T x), tvec2<T, P>
const & v)
56 return tvec2<R, P>(Func(v.x), Func(v.y));
60 template <
typename R,
typename T, precision P>
61 struct functor1<R, T, P, tvec3>
63 GLM_FUNC_QUALIFIER
static tvec3<R, P> call(R (*Func) (T x), tvec3<T, P>
const & v)
65 return tvec3<R, P>(Func(v.x), Func(v.y), Func(v.z));
69 template <
typename R,
typename T, precision P>
70 struct functor1<R, T, P, tvec4>
72 GLM_FUNC_QUALIFIER
static tvec4<R, P> call(R (*Func) (T x), tvec4<T, P>
const & v)
74 return tvec4<R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
78 template <
typename T, precision P,
template <
typename, precision>
class vecType>
81 template <
typename T, precision P>
82 struct functor2<T, P, tvec1>
84 GLM_FUNC_QUALIFIER
static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P>
const & a, tvec1<T, P>
const & b)
86 return tvec1<T, P>(Func(a.x, b.x));
90 template <
typename T, precision P>
91 struct functor2<T, P, tvec2>
93 GLM_FUNC_QUALIFIER
static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P>
const & a, tvec2<T, P>
const & b)
95 return tvec2<T, P>(Func(a.x, b.x), Func(a.y, b.y));
99 template <
typename T, precision P>
100 struct functor2<T, P, tvec3>
102 GLM_FUNC_QUALIFIER
static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P>
const & a, tvec3<T, P>
const & b)
104 return tvec3<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
108 template <
typename T, precision P>
109 struct functor2<T, P, tvec4>
111 GLM_FUNC_QUALIFIER
static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P>
const & a, tvec4<T, P>
const & b)
113 return tvec4<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
117 template <
typename T, precision P,
template <
typename, precision>
class vecType>
118 struct functor2_vec_sca{};
120 template <
typename T, precision P>
121 struct functor2_vec_sca<T, P, tvec1>
123 GLM_FUNC_QUALIFIER
static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P>
const & a, T b)
125 return tvec1<T, P>(Func(a.x, b));
129 template <
typename T, precision P>
130 struct functor2_vec_sca<T, P, tvec2>
132 GLM_FUNC_QUALIFIER
static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P>
const & a, T b)
134 return tvec2<T, P>(Func(a.x, b), Func(a.y, b));
138 template <
typename T, precision P>
139 struct functor2_vec_sca<T, P, tvec3>
141 GLM_FUNC_QUALIFIER
static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P>
const & a, T b)
143 return tvec3<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
147 template <
typename T, precision P>
148 struct functor2_vec_sca<T, P, tvec4>
150 GLM_FUNC_QUALIFIER
static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P>
const & a, T b)
152 return tvec4<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b));
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)