43 template <
typename R,
typename T, precision P,
template <
typename, precision>
class vecType>
46 template <
typename R,
typename T, precision P>
47 struct functor1<R, T, P, tvec1>
49 GLM_FUNC_QUALIFIER
static tvec1<R, P> call(R (*Func) (T x), tvec1<T, P>
const & v)
51 return tvec1<R, P>(Func(v.x));
55 template <
typename R,
typename T, precision P>
56 struct functor1<R, T, P, tvec2>
58 GLM_FUNC_QUALIFIER
static tvec2<R, P> call(R (*Func) (T x), tvec2<T, P>
const & v)
60 return tvec2<R, P>(Func(v.x), Func(v.y));
64 template <
typename R,
typename T, precision P>
65 struct functor1<R, T, P, tvec3>
67 GLM_FUNC_QUALIFIER
static tvec3<R, P> call(R (*Func) (T x), tvec3<T, P>
const & v)
69 return tvec3<R, P>(Func(v.x), Func(v.y), Func(v.z));
73 template <
typename R,
typename T, precision P>
74 struct functor1<R, T, P, tvec4>
76 GLM_FUNC_QUALIFIER
static tvec4<R, P> call(R (*Func) (T x), tvec4<T, P>
const & v)
78 return tvec4<R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
82 template <
typename T, precision P,
template <
typename, precision>
class vecType>
85 template <
typename T, precision P>
86 struct functor2<T, P, tvec1>
88 GLM_FUNC_QUALIFIER
static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P>
const & a, tvec1<T, P>
const & b)
90 return tvec1<T, P>(Func(a.x, b.x));
94 template <
typename T, precision P>
95 struct functor2<T, P, tvec2>
97 GLM_FUNC_QUALIFIER
static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P>
const & a, tvec2<T, P>
const & b)
99 return tvec2<T, P>(Func(a.x, b.x), Func(a.y, b.y));
103 template <
typename T, precision P>
104 struct functor2<T, P, tvec3>
106 GLM_FUNC_QUALIFIER
static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P>
const & a, tvec3<T, P>
const & b)
108 return tvec3<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
112 template <
typename T, precision P>
113 struct functor2<T, P, tvec4>
115 GLM_FUNC_QUALIFIER
static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P>
const & a, tvec4<T, P>
const & b)
117 return tvec4<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
121 template <
typename T, precision P,
template <
typename, precision>
class vecType>
122 struct functor2_vec_sca{};
124 template <
typename T, precision P>
125 struct functor2_vec_sca<T, P, tvec1>
127 GLM_FUNC_QUALIFIER
static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P>
const & a, T b)
129 return tvec1<T, P>(Func(a.x, b));
133 template <
typename T, precision P>
134 struct functor2_vec_sca<T, P, tvec2>
136 GLM_FUNC_QUALIFIER
static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P>
const & a, T b)
138 return tvec2<T, P>(Func(a.x, b), Func(a.y, b));
142 template <
typename T, precision P>
143 struct functor2_vec_sca<T, P, tvec3>
145 GLM_FUNC_QUALIFIER
static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P>
const & a, T b)
147 return tvec3<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
151 template <
typename T, precision P>
152 struct functor2_vec_sca<T, P, tvec4>
154 GLM_FUNC_QUALIFIER
static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P>
const & a, T b)
156 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)