| 1.0.2 API documentation

type_vec3.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<3, T, Q>
18 {
19 // -- Implementation detail --
20
21 typedef T value_type;
22 typedef vec<3, T, Q> type;
23 typedef vec<3, 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 # pragma clang diagnostic ignored "-Wpadded"
41 # elif GLM_COMPILER & GLM_COMPILER_VC
42 # pragma warning(push)
43 # pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
44 # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
45 # pragma warning(disable: 4324) // structure was padded due to alignment specifier
46 # endif
47 # endif
48 # endif
49
50 # if GLM_CONFIG_XYZW_ONLY
51 T x, y, z;
52 # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
53 GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, Q, x, y, z)
54 # endif//GLM_CONFIG_SWIZZLE
55 # elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE
56 union
57 {
58 struct{ T x, y, z; };
59 struct{ T r, g, b; };
60 struct{ T s, t, p; };
61
62 typename detail::storage<3, T, detail::is_aligned<Q>::value>::type data;
63
64 # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
65 GLM_SWIZZLE3_2_MEMBERS(T, Q, x, y, z)
66 GLM_SWIZZLE3_2_MEMBERS(T, Q, r, g, b)
67 GLM_SWIZZLE3_2_MEMBERS(T, Q, s, t, p)
68 GLM_SWIZZLE3_3_MEMBERS(T, Q, x, y, z)
69 GLM_SWIZZLE3_3_MEMBERS(T, Q, r, g, b)
70 GLM_SWIZZLE3_3_MEMBERS(T, Q, s, t, p)
71 GLM_SWIZZLE3_4_MEMBERS(T, Q, x, y, z)
72 GLM_SWIZZLE3_4_MEMBERS(T, Q, r, g, b)
73 GLM_SWIZZLE3_4_MEMBERS(T, Q, s, t, p)
74 # endif
75 };
76 # else
77 union { T x, r, s; };
78 union { T y, g, t; };
79 union { T z, b, p; };
80
81 # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
82 GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, Q)
83 # endif//GLM_CONFIG_SWIZZLE
84 # endif//GLM_LANG
85
86 # if GLM_SILENT_WARNINGS == GLM_ENABLE
87 # if GLM_COMPILER & GLM_COMPILER_CLANG
88 # pragma clang diagnostic pop
89 # elif GLM_COMPILER & GLM_COMPILER_GCC
90 # pragma GCC diagnostic pop
91 # elif GLM_COMPILER & GLM_COMPILER_VC
92 # pragma warning(pop)
93 # endif
94 # endif
95
96 // -- Component accesses --
97
99 typedef length_t length_type;
100 GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 3;}
101
102 GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i);
103 GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const;
104
105 // -- Implicit basic constructors --
106
107 GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR;
108 GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT;
109 template<qualifier P>
110 GLM_CTOR_DECL vec(vec<3, T, P> const& v);
111
112 // -- Explicit basic constructors --
113
114 GLM_CTOR_DECL explicit vec(T scalar);
115 GLM_CTOR_DECL vec(T a, T b, T c);
116
117 // -- Conversion scalar constructors --
118
119 template<typename U, qualifier P>
120 GLM_CTOR_DECL explicit vec(vec<1, U, P> const& v);
121
123 template<typename X, typename Y, typename Z>
124 GLM_CTOR_DECL vec(X x, Y y, Z z);
125 template<typename X, typename Y, typename Z>
126 GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, Z _z);
127 template<typename X, typename Y, typename Z>
128 GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, Z _z);
129 template<typename X, typename Y, typename Z>
130 GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z);
131 template<typename X, typename Y, typename Z>
132 GLM_CTOR_DECL vec(X _x, Y _y, vec<1, Z, Q> const& _z);
133 template<typename X, typename Y, typename Z>
134 GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z);
135 template<typename X, typename Y, typename Z>
136 GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z);
137 template<typename X, typename Y, typename Z>
138 GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z);
139
140 // -- Conversion vector constructors --
141
143 template<typename A, typename B, qualifier P>
144 GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, B _z);
146 template<typename A, typename B, qualifier P>
147 GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z);
149 template<typename A, typename B, qualifier P>
150 GLM_CTOR_DECL vec(A _x, vec<2, B, P> const& _yz);
152 template<typename A, typename B, qualifier P>
153 GLM_CTOR_DECL vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz);
155 template<typename U, qualifier P>
156 GLM_CTOR_DECL GLM_EXPLICIT vec(vec<4, U, P> const& v);
157
159 template<typename U, qualifier P>
160 GLM_CTOR_DECL GLM_EXPLICIT vec(vec<3, U, P> const& v);
161
162 // -- Swizzle constructors --
163 # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
164 template<int E0, int E1, int E2>
165 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& that)
166 {
167 *this = that();
168 }
169
170 template<int E0, int E1>
171 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& scalar)
172 {
173 *this = vec(v(), scalar);
174 }
175
176 template<int E0, int E1>
177 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec(T const& scalar, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v)
178 {
179 *this = vec(scalar, v());
180 }
181 # endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
182
183 // -- Unary arithmetic operators --
184
185 GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q>& operator=(vec<3, T, Q> const& v) GLM_DEFAULT;
186
187 template<typename U>
188 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator=(vec<3, U, Q> const& v);
189 template<typename U>
190 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(U scalar);
191 template<typename U>
192 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<1, U, Q> const& v);
193 template<typename U>
194 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<3, U, Q> const& v);
195 template<typename U>
196 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(U scalar);
197 template<typename U>
198 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<1, U, Q> const& v);
199 template<typename U>
200 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<3, U, Q> const& v);
201 template<typename U>
202 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(U scalar);
203 template<typename U>
204 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<1, U, Q> const& v);
205 template<typename U>
206 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<3, U, Q> const& v);
207 template<typename U>
208 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(U scalar);
209 template<typename U>
210 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<1, U, Q> const& v);
211 template<typename U>
212 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<3, U, Q> const& v);
213
214 // -- Increment and decrement operators --
215
216 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator++();
217 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator--();
218 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator++(int);
219 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator--(int);
220
221 // -- Unary bit operators --
222
223 template<typename U>
224 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(U scalar);
225 template<typename U>
226 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<1, U, Q> const& v);
227 template<typename U>
228 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<3, U, Q> const& v);
229 template<typename U>
230 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(U scalar);
231 template<typename U>
232 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<1, U, Q> const& v);
233 template<typename U>
234 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<3, U, Q> const& v);
235 template<typename U>
236 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(U scalar);
237 template<typename U>
238 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<1, U, Q> const& v);
239 template<typename U>
240 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<3, U, Q> const& v);
241 template<typename U>
242 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(U scalar);
243 template<typename U>
244 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<1, U, Q> const& v);
245 template<typename U>
246 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<3, U, Q> const& v);
247 template<typename U>
248 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(U scalar);
249 template<typename U>
250 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<1, U, Q> const& v);
251 template<typename U>
252 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<3, U, Q> const& v);
253 template<typename U>
254 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(U scalar);
255 template<typename U>
256 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<1, U, Q> const& v);
257 template<typename U>
258 GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<3, U, Q> const& v);
259 };
260
261
262
263 // -- Unary operators --
264
265 template<typename T, qualifier Q>
266 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v);
267
268 template<typename T, qualifier Q>
269 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v);
270
271 // -- Binary operators --
272
273 template<typename T, qualifier Q>
274 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar);
275
276 template<typename T, qualifier Q>
277 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar);
278
279 template<typename T, qualifier Q>
280 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v);
281
282 template<typename T, qualifier Q>
283 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
284
285 template<typename T, qualifier Q>
286 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
287
288 template<typename T, qualifier Q>
289 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar);
290
291 template<typename T, qualifier Q>
292 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
293
294 template<typename T, qualifier Q>
295 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v);
296
297 template<typename T, qualifier Q>
298 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
299
300 template<typename T, qualifier Q>
301 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
302
303 template<typename T, qualifier Q>
304 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar);
305
306 template<typename T, qualifier Q>
307 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
308
309 template<typename T, qualifier Q>
310 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v);
311
312 template<typename T, qualifier Q>
313 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
314
315 template<typename T, qualifier Q>
316 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
317
318 template<typename T, qualifier Q>
319 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar);
320
321 template<typename T, qualifier Q>
322 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
323
324 template<typename T, qualifier Q>
325 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v);
326
327 template<typename T, qualifier Q>
328 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
329
330 template<typename T, qualifier Q>
331 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
332
333 template<typename T, qualifier Q>
334 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar);
335
336 template<typename T, qualifier Q>
337 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
338
339 template<typename T, qualifier Q>
340 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v);
341
342 template<typename T, qualifier Q>
343 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
344
345 template<typename T, qualifier Q>
346 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
347
348 template<typename T, qualifier Q>
349 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, T scalar);
350
351 template<typename T, qualifier Q>
352 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
353
354 template<typename T, qualifier Q>
355 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v);
356
357 template<typename T, qualifier Q>
358 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
359
360 template<typename T, qualifier Q>
361 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
362
363 template<typename T, qualifier Q>
364 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar);
365
366 template<typename T, qualifier Q>
367 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
368
369 template<typename T, qualifier Q>
370 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v);
371
372 template<typename T, qualifier Q>
373 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
374
375 template<typename T, qualifier Q>
376 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
377
378 template<typename T, qualifier Q>
379 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar);
380
381 template<typename T, qualifier Q>
382 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
383
384 template<typename T, qualifier Q>
385 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v);
386
387 template<typename T, qualifier Q>
388 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
389
390 template<typename T, qualifier Q>
391 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
392
393 template<typename T, qualifier Q>
394 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar);
395
396 template<typename T, qualifier Q>
397 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
398
399 template<typename T, qualifier Q>
400 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v);
401
402 template<typename T, qualifier Q>
403 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
404
405 template<typename T, qualifier Q>
406 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
407
408 template<typename T, qualifier Q>
409 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar);
410
411 template<typename T, qualifier Q>
412 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
413
414 template<typename T, qualifier Q>
415 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v);
416
417 template<typename T, qualifier Q>
418 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
419
420 template<typename T, qualifier Q>
421 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
422
423 template<typename T, qualifier Q>
424 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator~(vec<3, T, Q> const& v);
425
426 // -- Boolean operators --
427
428 template<typename T, qualifier Q>
429 GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
430
431 template<typename T, qualifier Q>
432 GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
433
434 template<qualifier Q>
435 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2);
436
437 template<qualifier Q>
438 GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2);
439
440
441
442
443 }//namespace glm
444
445 #ifndef GLM_EXTERNAL_TEMPLATE
446 #include "type_vec3.inl"
447 #endif//GLM_EXTERNAL_TEMPLATE
glm::length
GLM_FUNC_DECL T length(qua< T, Q > const &q)
Returns the norm of a quaternions.