| 1.0.2 API documentation

type_vec4.hpp
Go to the documentation of this file.
1
4 #pragma once
5
6 #include "qualifier.hpp"
7 #if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
8 # include "_swizzle.hpp"
9 #elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
10 # include "_swizzle_func.hpp"
11 #endif
12 #include <cstddef>
13
14 namespace glm
15 {
16 template<typename T, qualifier Q>
17 struct vec<4, T, Q>
18 {
19 // -- Implementation detail --
20
21 typedef T value_type;
22 typedef vec<4, T, Q> type;
23 typedef vec<4, bool, Q> bool_type;
24
25 enum is_aligned
26 {
27 value = detail::is_aligned<Q>::value
28 };
29
30 // -- Data --
31
32 # if GLM_SILENT_WARNINGS == GLM_ENABLE
33 # if GLM_COMPILER & GLM_COMPILER_GCC
34 # pragma GCC diagnostic push
35 # pragma GCC diagnostic ignored "-Wpedantic"
36 # elif GLM_COMPILER & GLM_COMPILER_CLANG
37 # pragma clang diagnostic push
38 # pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
39 # pragma clang diagnostic ignored "-Wnested-anon-types"
40 # elif GLM_COMPILER & GLM_COMPILER_VC
41 # pragma warning(push)
42 # pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
43 # endif
44 # endif
45
46 # if GLM_CONFIG_XYZW_ONLY
47 T x, y, z, w;
48 # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
49 GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, Q, x, y, z, w)
50 # endif//GLM_CONFIG_SWIZZLE
51 # elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE
52 union
53 {
54 struct { T x, y, z, w; };
55 struct { T r, g, b, a; };
56 struct { T s, t, p, q; };
57
58 typename detail::storage<4, T, detail::is_aligned<Q>::value>::type data;
59
60 # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
61 GLM_SWIZZLE4_2_MEMBERS(T, Q, x, y, z, w)
62 GLM_SWIZZLE4_2_MEMBERS(T, Q, r, g, b, a)
63 GLM_SWIZZLE4_2_MEMBERS(T, Q, s, t, p, q)
64 GLM_SWIZZLE4_3_MEMBERS(T, Q, x, y, z, w)
65 GLM_SWIZZLE4_3_MEMBERS(T, Q, r, g, b, a)
66 GLM_SWIZZLE4_3_MEMBERS(T, Q, s, t, p, q)
67 GLM_SWIZZLE4_4_MEMBERS(T, Q, x, y, z, w)
68 GLM_SWIZZLE4_4_MEMBERS(T, Q, r, g, b, a)
69 GLM_SWIZZLE4_4_MEMBERS(T, Q, s, t, p, q)
70 # endif
71 };
72 # else
73 union { T x, r, s; };
74 union { T y, g, t; };
75 union { T z, b, p; };
76 union { T w, a, q; };
77
78 # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
79 GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, Q)
80 # endif
81 # endif
82
83 # if GLM_SILENT_WARNINGS == GLM_ENABLE
84 # if GLM_COMPILER & GLM_COMPILER_CLANG
85 # pragma clang diagnostic pop
86 # elif GLM_COMPILER & GLM_COMPILER_GCC
87 # pragma GCC diagnostic pop
88 # elif GLM_COMPILER & GLM_COMPILER_VC
89 # pragma warning(pop)
90 # endif
91 # endif
92
93 // -- Component accesses --
94
95 typedef length_t length_type;
96
98 GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;}
99
100 GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i);
101 GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const;
102
103 // -- Implicit basic constructors --
104
105 GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR;
106 GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec(vec<4, T, Q> const& v) GLM_DEFAULT;
107 template<qualifier P>
108 GLM_CTOR_DECL vec(vec<4, T, P> const& v);
109
110 // -- Explicit basic constructors --
111
112 GLM_CTOR_DECL explicit vec(T scalar);
113 GLM_CTOR_DECL vec(T x, T y, T z, T w);
114
115 // -- Conversion scalar constructors --
116
117 template<typename U, qualifier P>
118 GLM_CTOR_DECL explicit vec(vec<1, U, P> const& v);
119
121 template<typename X, typename Y, typename Z, typename W>
122 GLM_CTOR_DECL vec(X _x, Y _y, Z _z, W _w);
123 template<typename X, typename Y, typename Z, typename W>
124 GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, Z _z, W _w);
125 template<typename X, typename Y, typename Z, typename W>
126 GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, Z _z, W _w);
127 template<typename X, typename Y, typename Z, typename W>
128 GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, W _w);
129 template<typename X, typename Y, typename Z, typename W>
130 GLM_CTOR_DECL vec(X _x, Y _y, vec<1, Z, Q> const& _z, W _w);
131 template<typename X, typename Y, typename Z, typename W>
132 GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, W _w);
133 template<typename X, typename Y, typename Z, typename W>
134 GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w);
135 template<typename X, typename Y, typename Z, typename W>
136 GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w);
137 template<typename X, typename Y, typename Z, typename W>
138 GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, Z _z, vec<1, W, Q> const& _w);
139 template<typename X, typename Y, typename Z, typename W>
140 GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w);
141 template<typename X, typename Y, typename Z, typename W>
142 GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w);
143 template<typename X, typename Y, typename Z, typename W>
144 GLM_CTOR_DECL vec(X _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w);
145 template<typename X, typename Y, typename Z, typename W>
146 GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w);
147 template<typename X, typename Y, typename Z, typename W>
148 GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w);
149 template<typename X, typename Y, typename Z, typename W>
150 GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w);
151
152 // -- Conversion vector constructors --
153
155 template<typename A, typename B, typename C, qualifier P>
156 GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, B _z, C _w);
158 template<typename A, typename B, typename C, qualifier P>
159 GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, C _w);
161 template<typename A, typename B, typename C, qualifier P>
162 GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, B _z, vec<1, C, P> const& _w);
164 template<typename A, typename B, typename C, qualifier P>
165 GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w);
167 template<typename A, typename B, typename C, qualifier P>
168 GLM_CTOR_DECL vec(A _x, vec<2, B, P> const& _yz, C _w);
170 template<typename A, typename B, typename C, qualifier P>
171 GLM_CTOR_DECL vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, C _w);
173 template<typename A, typename B, typename C, qualifier P>
174 GLM_CTOR_DECL vec(A _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w);
176 template<typename A, typename B, typename C, qualifier P>
177 GLM_CTOR_DECL vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w);
179 template<typename A, typename B, typename C, qualifier P>
180 GLM_CTOR_DECL vec(A _x, B _y, vec<2, C, P> const& _zw);
182 template<typename A, typename B, typename C, qualifier P>
183 GLM_CTOR_DECL vec(vec<1, A, P> const& _x, B _y, vec<2, C, P> const& _zw);
185 template<typename A, typename B, typename C, qualifier P>
186 GLM_CTOR_DECL vec(A _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw);
188 template<typename A, typename B, typename C, qualifier P>
189 GLM_CTOR_DECL vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw);
191 template<typename A, typename B, qualifier P>
192 GLM_CTOR_DECL vec(vec<3, A, P> const& _xyz, B _w);
194 template<typename A, typename B, qualifier P>
195 GLM_CTOR_DECL vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w);
197 template<typename A, typename B, qualifier P>
198 GLM_CTOR_DECL vec(A _x, vec<3, B, P> const& _yzw);
200 template<typename A, typename B, qualifier P>
201 GLM_CTOR_DECL vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw);
203 template<typename A, typename B, qualifier P>
204 GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw);
205
207 template<typename U, qualifier P>
208 GLM_CTOR_DECL GLM_EXPLICIT vec(vec<4, U, P> const& v);
209
210 // -- Swizzle constructors --
211 # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
212 template<int E0, int E1, int E2, int E3>
213 GLM_FUNC_DISCARD_DECL vec(detail::_swizzle<4, T, Q, E0, E1, E2, E3> const& that)
214 {
215 *this = that();
216 }
217
218 template<int E0, int E1, int F0, int F1>
219 GLM_FUNC_DISCARD_DECL vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, detail::_swizzle<2, T, Q, F0, F1, -1, -2> const& u)
220 {
221 *this = vec<4, T, Q>(v(), u());
222 }
223
224 template<int E0, int E1>
225 GLM_FUNC_DISCARD_DECL vec(T const& x, T const& y, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v)
226 {
227 *this = vec<4, T, Q>(x, y, v());
228 }
229
230 template<int E0, int E1>
231 GLM_FUNC_DISCARD_DECL vec(T const& x, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& w)
232 {
233 *this = vec<4, T, Q>(x, v(), w);
234 }
235
236 template<int E0, int E1>
237 GLM_FUNC_DISCARD_DECL vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& z, T const& w)
238 {
239 *this = vec<4, T, Q>(v(), z, w);
240 }
241
242 template<int E0, int E1, int E2>
243 GLM_FUNC_DISCARD_DECL vec(detail::_swizzle<3, T, Q, E0, E1, E2, 3> const& v, T const& w)
244 {
245 *this = vec<4, T, Q>(v(), w);
246 }
247
248 template<int E0, int E1, int E2>
249 GLM_FUNC_DISCARD_DECL vec(T const& x, detail::_swizzle<3, T, Q, E0, E1, E2, 3> const& v)
250 {
251 *this = vec<4, T, Q>(x, v());
252 }
253 # endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
254
255 // -- Unary arithmetic operators --
256
257 GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, T, Q> const& v) GLM_DEFAULT;
258
259 template<typename U>
260 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, U, Q> const& v);
261 template<typename U>
262 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(U scalar);
263 template<typename U>
264 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<1, U, Q> const& v);
265 template<typename U>
266 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<4, U, Q> const& v);
267 template<typename U>
268 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(U scalar);
269 template<typename U>
270 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<1, U, Q> const& v);
271 template<typename U>
272 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<4, U, Q> const& v);
273 template<typename U>
274 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(U scalar);
275 template<typename U>
276 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<1, U, Q> const& v);
277 template<typename U>
278 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<4, U, Q> const& v);
279 template<typename U>
280 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(U scalar);
281 template<typename U>
282 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<1, U, Q> const& v);
283 template<typename U>
284 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<4, U, Q> const& v);
285
286 // -- Increment and decrement operators --
287
288 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q> & operator++();
289 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q> & operator--();
290 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator++(int);
291 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator--(int);
292
293 // -- Unary bit operators --
294
295 template<typename U>
296 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(U scalar);
297 template<typename U>
298 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<1, U, Q> const& v);
299 template<typename U>
300 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<4, U, Q> const& v);
301 template<typename U>
302 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(U scalar);
303 template<typename U>
304 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<1, U, Q> const& v);
305 template<typename U>
306 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<4, U, Q> const& v);
307 template<typename U>
308 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(U scalar);
309 template<typename U>
310 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<1, U, Q> const& v);
311 template<typename U>
312 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<4, U, Q> const& v);
313 template<typename U>
314 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(U scalar);
315 template<typename U>
316 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<1, U, Q> const& v);
317 template<typename U>
318 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<4, U, Q> const& v);
319 template<typename U>
320 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(U scalar);
321 template<typename U>
322 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<1, U, Q> const& v);
323 template<typename U>
324 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<4, U, Q> const& v);
325 template<typename U>
326 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(U scalar);
327 template<typename U>
328 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<1, U, Q> const& v);
329 template<typename U>
330 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<4, U, Q> const& v);
331 };
332
333
334 // -- Unary operators --
335
336 template<typename T, qualifier Q>
337 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v);
338
339 template<typename T, qualifier Q>
340 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v);
341
342 // -- Binary operators --
343
344 template<typename T, qualifier Q>
345 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T scalar);
346
347 template<typename T, qualifier Q>
348 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2);
349
350 template<typename T, qualifier Q>
351 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v);
352
353 template<typename T, qualifier Q>
354 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2);
355
356 template<typename T, qualifier Q>
357 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
358
359 template<typename T, qualifier Q>
360 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T scalar);
361
362 template<typename T, qualifier Q>
363 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2);
364
365 template<typename T, qualifier Q>
366 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v);
367
368 template<typename T, qualifier Q>
369 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2);
370
371 template<typename T, qualifier Q>
372 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
373
374 template<typename T, qualifier Q>
375 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T scalar);
376
377 template<typename T, qualifier Q>
378 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2);
379
380 template<typename T, qualifier Q>
381 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v);
382
383 template<typename T, qualifier Q>
384 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2);
385
386 template<typename T, qualifier Q>
387 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
388
389 template<typename T, qualifier Q>
390 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T scalar);
391
392 template<typename T, qualifier Q>
393 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2);
394
395 template<typename T, qualifier Q>
396 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v);
397
398 template<typename T, qualifier Q>
399 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2);
400
401 template<typename T, qualifier Q>
402 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
403
404 template<typename T, qualifier Q>
405 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar);
406
407 template<typename T, qualifier Q>
408 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
409
410 template<typename T, qualifier Q>
411 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v);
412
413 template<typename T, qualifier Q>
414 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
415
416 template<typename T, qualifier Q>
417 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
418
419 template<typename T, qualifier Q>
420 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar);
421
422 template<typename T, qualifier Q>
423 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
424
425 template<typename T, qualifier Q>
426 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v);
427
428 template<typename T, qualifier Q>
429 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
430
431 template<typename T, qualifier Q>
432 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
433
434 template<typename T, qualifier Q>
435 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar);
436
437 template<typename T, qualifier Q>
438 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
439
440 template<typename T, qualifier Q>
441 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v);
442
443 template<typename T, qualifier Q>
444 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
445
446 template<typename T, qualifier Q>
447 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
448
449 template<typename T, qualifier Q>
450 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar);
451
452 template<typename T, qualifier Q>
453 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
454
455 template<typename T, qualifier Q>
456 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v);
457
458 template<typename T, qualifier Q>
459 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
460
461 template<typename T, qualifier Q>
462 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
463
464 template<typename T, qualifier Q>
465 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar);
466
467 template<typename T, qualifier Q>
468 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
469
470 template<typename T, qualifier Q>
471 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v);
472
473 template<typename T, qualifier Q>
474 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
475
476 template<typename T, qualifier Q>
477 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
478
479 template<typename T, qualifier Q>
480 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar);
481
482 template<typename T, qualifier Q>
483 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
484
485 template<typename T, qualifier Q>
486 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v);
487
488 template<typename T, qualifier Q>
489 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
490
491 template<typename T, qualifier Q>
492 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
493
494 template<typename T, qualifier Q>
495 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator~(vec<4, T, Q> const& v);
496
497 // -- Boolean operators --
498
499 template<typename T, qualifier Q>
500 GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
501
502 template<typename T, qualifier Q>
503 GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
504
505 template<qualifier Q>
506 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2);
507
508 template<qualifier Q>
509 GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2);
510 }//namespace glm
511
512 #ifndef GLM_EXTERNAL_TEMPLATE
513 #include "type_vec4.inl"
514 #endif//GLM_EXTERNAL_TEMPLATE
glm::length
GLM_FUNC_DECL T length(qua< T, Q > const &q)
Returns the norm of a quaternions.