0.9.9 API documenation: type_vec4.hpp Source File

| 0.9.9 API documenation

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