0.9.9 API documentation: type_vec4.hpp Source File

| 0.9.9 API documentation

- Main Page
- Modules
- Files

- File List

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