29 #ifndef glm_core_type_gentype4 30 #define glm_core_type_gentype4 41 template <
typename T>
struct tref2;
42 template <
typename T>
struct tref3;
43 template <
typename T>
struct tref4;
44 template <
typename T>
struct tvec2;
45 template <
typename T>
struct tvec3;
55 typedef std::size_t size_type;
56 GLM_FUNC_DECL size_type length()
const;
58 typedef tvec4<T> type;
59 typedef tvec4<bool> bool_type;
64 # if(GLM_COMPONENT == GLM_COMPONENT_CXX11) 67 # if(defined(GLM_SWIZZLE)) 69 _GLM_SWIZZLE4_2_MEMBERS(value_type,
glm::detail::tvec2<value_type>, r, g, b, a)
70 _GLM_SWIZZLE4_2_MEMBERS(value_type,
glm::detail::tvec2<value_type>, s, t, p, q)
71 _GLM_SWIZZLE4_3_MEMBERS(value_type,
glm::detail::tvec3<value_type>, x, y, z, w)
72 _GLM_SWIZZLE4_3_MEMBERS(value_type,
glm::detail::tvec3<value_type>, r, g, b, a)
73 _GLM_SWIZZLE4_3_MEMBERS(value_type,
glm::detail::tvec3<value_type>, s, t, p, q)
74 _GLM_SWIZZLE4_4_MEMBERS(value_type,
glm::detail::tvec4<value_type>, x, y, z, w)
75 _GLM_SWIZZLE4_4_MEMBERS(value_type,
glm::detail::tvec4<value_type>, r, g, b, a)
76 _GLM_SWIZZLE4_4_MEMBERS(value_type,
glm::detail::tvec4<value_type>, s, t, p, q)
77 # endif//(defined(GLM_SWIZZLE)) 79 struct{value_type r, g, b, a;};
80 struct{value_type s, t, p, q;};
81 struct{value_type x, y, z, w;};
83 # elif(GLM_COMPONENT == GLM_COMPONENT_CXX98) 84 union {value_type x, r, s;};
85 union {value_type y, g, t;};
86 union {value_type z, b, p;};
87 union {value_type w, a, q;};
89 # if(defined(GLM_SWIZZLE)) 91 GLM_SWIZZLE_GEN_REF_FROM_VEC4(T, detail::tvec4, detail::tref2, detail::tref3, detail::tref4)
92 GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, detail::tvec4, detail::tvec2, detail::tvec3, detail::tvec4)
93 # endif//(defined(GLM_SWIZZLE)) 94 # else //(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) 95 value_type x, y, z, w;
97 # if(defined(GLM_SWIZZLE)) 99 GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, detail::tvec4, detail::tref2, detail::tref3, detail::tref4, x, y, z, w)
100 GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, detail::tvec4, detail::tvec2, detail::tvec3, detail::tvec4, x, y, z, w)
101 # endif//(defined(GLM_SWIZZLE)) 102 # endif//GLM_COMPONENT 107 GLM_FUNC_DECL value_type & operator[](size_type i);
108 GLM_FUNC_DECL value_type
const & operator[](size_type i)
const;
113 GLM_FUNC_DECL tvec4();
114 GLM_FUNC_DECL tvec4(type
const & v);
119 GLM_FUNC_DECL
explicit tvec4(
121 GLM_FUNC_DECL
explicit tvec4(
122 value_type
const & s);
123 GLM_FUNC_DECL
explicit tvec4(
124 value_type
const & s0,
125 value_type
const & s1,
126 value_type
const & s2,
127 value_type
const & s3);
133 template <
typename U>
134 GLM_FUNC_DECL
explicit tvec4(
137 template <
typename A,
typename B,
typename C,
typename D>
138 GLM_FUNC_DECL
explicit tvec4(
148 template <
typename A,
typename B,
typename C>
149 GLM_FUNC_DECL
explicit tvec4(tvec2<A>
const & v, B
const & s1, C
const & s2);
151 template <
typename A,
typename B,
typename C>
152 GLM_FUNC_DECL
explicit tvec4(A
const & s1, tvec2<B>
const & v, C
const & s2);
154 template <
typename A,
typename B,
typename C>
155 GLM_FUNC_DECL
explicit tvec4(A
const & s1, B
const & s2, tvec2<C>
const & v);
157 template <
typename A,
typename B>
158 GLM_FUNC_DECL
explicit tvec4(tvec3<A>
const & v, B
const & s);
160 template <
typename A,
typename B>
161 GLM_FUNC_DECL
explicit tvec4(A
const & s, tvec3<B>
const & v);
163 template <
typename A,
typename B>
164 GLM_FUNC_DECL
explicit tvec4(tvec2<A>
const & v1, tvec2<B>
const & v2);
166 template <
typename U>
167 GLM_FUNC_DECL
explicit tvec4(tvec4<U>
const & v);
169 template <
int E0,
int E1,
int E2,
int E3>
175 template <
int E0,
int E1,
int F0,
int F1>
176 GLM_FUNC_DECL tvec4(
glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2>
const & v,
glm::detail::swizzle<2, T, tvec2<T>, F0, F1, -1, -2>
const & u)
178 *
this = tvec4<T>(v(), u());
181 template <
int E0,
int E1>
182 GLM_FUNC_DECL tvec4(T
const & x, T
const & y,
glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2>
const & v)
184 *
this = tvec4<T>(x, y, v());
187 template <
int E0,
int E1>
188 GLM_FUNC_DECL tvec4(T
const & x,
glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2>
const & v, T
const & w)
190 *
this = tvec4<T>(x, v(), w);
193 template <
int E0,
int E1>
194 GLM_FUNC_DECL tvec4(
glm::detail::swizzle<2, T, tvec2<T>, E0, E1, -1, -2>
const & v, T
const & z, T
const & w)
196 *
this = tvec4<T>(v(), z, w);
199 template <
int E0,
int E1,
int E2>
200 GLM_FUNC_DECL tvec4(
glm::detail::swizzle<3, T, tvec3<T>, E0, E1, E2, -1>
const & v, T
const & w)
202 *
this = tvec4<T>(v(), w);
205 template <
int E0,
int E1,
int E2>
206 GLM_FUNC_DECL tvec4(T
const & x,
glm::detail::swizzle<3, T, tvec3<T>, E0, E1, E2, -1>
const & v)
208 *
this = tvec4<T>(x, v());
214 GLM_FUNC_DECL tvec4(tref4<T>
const & r);
217 template <
typename A,
typename B,
typename C>
218 GLM_FUNC_DECL
explicit tvec4(tref2<A>
const & v, B
const & s1, C
const & s2);
220 template <
typename A,
typename B,
typename C>
221 GLM_FUNC_DECL
explicit tvec4(A
const & s1, tref2<B>
const & v, C
const & s2);
223 template <
typename A,
typename B,
typename C>
224 GLM_FUNC_DECL
explicit tvec4(A
const & s1, B
const & s2, tref2<C>
const & v);
226 template <
typename A,
typename B>
227 GLM_FUNC_DECL
explicit tvec4(tref3<A>
const & v, B
const & s);
229 template <
typename A,
typename B>
230 GLM_FUNC_DECL
explicit tvec4(A
const & s, tref3<B>
const & v);
232 template <
typename A,
typename B>
233 GLM_FUNC_DECL
explicit tvec4(tref2<A>
const & v1, tref2<B>
const & v2);
235 template <
typename A,
typename B>
236 GLM_FUNC_DECL
explicit tvec4(tvec2<A>
const & v1, tref2<B>
const & v2);
238 template <
typename A,
typename B>
239 GLM_FUNC_DECL
explicit tvec4(tref2<A>
const & v1, tvec2<B>
const & v2);
244 GLM_FUNC_DECL tvec4<T> & operator= (tvec4<T>
const & v);
245 template <
typename U>
246 GLM_FUNC_DECL tvec4<T> & operator= (tvec4<U>
const & v);
248 template <
typename U>
249 GLM_FUNC_DECL tvec4<T> & operator+=(U
const & s);
250 template <
typename U>
251 GLM_FUNC_DECL tvec4<T> & operator+=(tvec4<U>
const & v);
252 template <
typename U>
253 GLM_FUNC_DECL tvec4<T> & operator-=(U
const & s);
254 template <
typename U>
255 GLM_FUNC_DECL tvec4<T> & operator-=(tvec4<U>
const & v);
256 template <
typename U>
257 GLM_FUNC_DECL tvec4<T> & operator*=(U
const & s);
258 template <
typename U>
259 GLM_FUNC_DECL tvec4<T> & operator*=(tvec4<U>
const & v);
260 template <
typename U>
261 GLM_FUNC_DECL tvec4<T> & operator/=(U
const & s);
262 template <
typename U>
263 GLM_FUNC_DECL tvec4<T> & operator/=(tvec4<U>
const & v);
264 GLM_FUNC_DECL tvec4<T> & operator++();
265 GLM_FUNC_DECL tvec4<T> & operator--();
270 template <
typename U>
271 GLM_FUNC_DECL tvec4<T> & operator%= (U
const & s);
272 template <
typename U>
273 GLM_FUNC_DECL tvec4<T> & operator%= (tvec4<U>
const & v);
274 template <
typename U>
275 GLM_FUNC_DECL tvec4<T> & operator&= (U
const & s);
276 template <
typename U>
277 GLM_FUNC_DECL tvec4<T> & operator&= (tvec4<U>
const & v);
278 template <
typename U>
279 GLM_FUNC_DECL tvec4<T> & operator|= (U
const & s);
280 template <
typename U>
281 GLM_FUNC_DECL tvec4<T> & operator|= (tvec4<U>
const & v);
282 template <
typename U>
283 GLM_FUNC_DECL tvec4<T> & operator^= (U
const & s);
284 template <
typename U>
285 GLM_FUNC_DECL tvec4<T> & operator^= (tvec4<U>
const & v);
286 template <
typename U>
287 GLM_FUNC_DECL tvec4<T> & operator<<=(U
const & s);
288 template <
typename U>
289 GLM_FUNC_DECL tvec4<T> & operator<<=(tvec4<U>
const & v);
290 template <
typename U>
291 GLM_FUNC_DECL tvec4<T> & operator>>=(U
const & s);
292 template <
typename U>
293 GLM_FUNC_DECL tvec4<T> & operator>>=(tvec4<U>
const & v);
298 GLM_FUNC_DECL value_type swizzle(comp X)
const;
299 GLM_FUNC_DECL tvec2<T> swizzle(comp X, comp Y)
const;
300 GLM_FUNC_DECL tvec3<T> swizzle(comp X, comp Y, comp Z)
const;
301 GLM_FUNC_DECL tvec4<T> swizzle(comp X, comp Y, comp Z, comp W)
const;
302 GLM_FUNC_DECL tref2<T> swizzle(comp X, comp Y);
303 GLM_FUNC_DECL tref3<T> swizzle(comp X, comp Y, comp Z);
304 GLM_FUNC_DECL tref4<T> swizzle(comp X, comp Y, comp Z, comp W);
307 template <
typename T>
310 GLM_FUNC_DECL tref4(T & x, T & y, T & z, T & w);
311 GLM_FUNC_DECL tref4(tref4<T>
const & r);
312 GLM_FUNC_DECL
explicit tref4(tvec4<T>
const & v);
314 GLM_FUNC_DECL tref4<T> & operator= (tref4<T>
const & r);
315 GLM_FUNC_DECL tref4<T> & operator= (tvec4<T>
const & v);
317 GLM_FUNC_DECL tvec4<T> operator() ();
325 GLM_DETAIL_IS_VECTOR(tvec4);
397 #ifndef GLM_EXTERNAL_TEMPLATE 398 #include "type_vec4.inl" 399 #endif//GLM_EXTERNAL_TEMPLATE 401 #endif//glm_core_type_gentype4 detail::tvec4< lowp_float > lowp_vec4
4 components vector of low precision floating-point numbers.
Definition: type_vec4.hpp:350
OpenGL Mathematics (glm.g-truc.net)
detail::tvec4< highp_float > highp_vec4
4 components vector of high precision floating-point numbers.
Definition: type_vec4.hpp:336
Definition: _swizzle.hpp:204
Definition: _detail.hpp:38
detail::tvec4< lowp_uint > lowp_uvec4
4 components vector of low precision unsigned integer numbers.
Definition: type_vec4.hpp:392
Definition: type_mat2x2.hpp:38
detail::tvec4< lowp_int > lowp_ivec4
4 components vector of low precision signed integer numbers.
Definition: type_vec4.hpp:371
detail::tvec4< mediump_uint > mediump_uvec4
4 components vector of medium precision unsigned integer numbers.
Definition: type_vec4.hpp:385
detail::tvec4< mediump_int > mediump_ivec4
4 components vector of medium precision signed integer numbers.
Definition: type_vec4.hpp:364
OpenGL Mathematics (glm.g-truc.net)
detail::tvec4< highp_int > highp_ivec4
4 components vector of high precision signed integer numbers.
Definition: type_vec4.hpp:357
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)
Definition: type_mat2x2.hpp:40
detail::tvec4< mediump_float > mediump_vec4
4 components vector of medium precision floating-point numbers.
Definition: type_vec4.hpp:343
detail::tvec4< highp_uint > highp_uvec4
4 components vector of high precision unsigned integer numbers.
Definition: type_vec4.hpp:378