GLM 0.9.5

- Main Page
- Related Pages
- Modules
- Namespaces
- Files

- File List

type_vec.hpp
1
29 #ifndef glm_core_type_vec
30 #define glm_core_type_vec
31
32 #include "precision.hpp"
33 #include "type_int.hpp"
34
35 namespace glm{
36 namespace detail
37 {
38 template <typename T, precision P> struct tvec1;
39 template <typename T, precision P> struct tvec2;
40 template <typename T, precision P> struct tvec3;
41 template <typename T, precision P> struct tvec4;
42
43 template <typename T>
44 struct is_vector
45 {
46 enum is_vector_enum
47 {
48 _YES = 0,
49 _NO = 1
50 };
51 };
52
53 # define GLM_DETAIL_IS_VECTOR(TYPE) \
54 template <typename T, precision P> \
55 struct is_vector<TYPE<T, P> > \
56 { \
57 enum is_vector_enum \
58 { \
59 _YES = 1, \
60 _NO = 0 \
61 }; \
62 }
63 }//namespace detail
64
65 typedef detail::tvec1<float, highp> highp_vec1_t;
66 typedef detail::tvec1<float, mediump> mediump_vec1_t;
67 typedef detail::tvec1<float, lowp> lowp_vec1_t;
68 typedef detail::tvec1<int, highp> highp_ivec1_t;
69 typedef detail::tvec1<int, mediump> mediump_ivec1_t;
70 typedef detail::tvec1<int, lowp> lowp_ivec1_t;
71 typedef detail::tvec1<uint, highp> highp_uvec1_t;
72 typedef detail::tvec1<uint, mediump> mediump_uvec1_t;
73 typedef detail::tvec1<uint, lowp> lowp_uvec1_t;
74 typedef detail::tvec1<bool, highp> highp_bvec1_t;
75 typedef detail::tvec1<bool, mediump> mediump_bvec1_t;
76 typedef detail::tvec1<bool, lowp> lowp_bvec1_t;
77
80
86 typedef detail::tvec2<float, highp> highp_vec2;
87
93 typedef detail::tvec2<float, mediump> mediump_vec2;
94
100 typedef detail::tvec2<float, lowp> lowp_vec2;
101
107 typedef detail::tvec2<double, highp> highp_dvec2;
108
114 typedef detail::tvec2<double, mediump> mediump_dvec2;
115
121 typedef detail::tvec2<double, lowp> lowp_dvec2;
122
128 typedef detail::tvec2<int, highp> highp_ivec2;
129
135 typedef detail::tvec2<int, mediump> mediump_ivec2;
136
142 typedef detail::tvec2<int, lowp> lowp_ivec2;
143
149 typedef detail::tvec2<uint, highp> highp_uvec2;
150
156 typedef detail::tvec2<uint, mediump> mediump_uvec2;
157
163 typedef detail::tvec2<uint, lowp> lowp_uvec2;
164
170 typedef detail::tvec2<bool, highp> highp_bvec2;
171
177 typedef detail::tvec2<bool, mediump> mediump_bvec2;
178
184 typedef detail::tvec2<bool, lowp> lowp_bvec2;
185
187
188
191
197 typedef detail::tvec3<float, highp> highp_vec3;
198
204 typedef detail::tvec3<float, mediump> mediump_vec3;
205
211 typedef detail::tvec3<float, lowp> lowp_vec3;
212
218 typedef detail::tvec3<double, highp> highp_dvec3;
219
225 typedef detail::tvec3<double, mediump> mediump_dvec3;
226
232 typedef detail::tvec3<double, lowp> lowp_dvec3;
233
239 typedef detail::tvec3<int, highp> highp_ivec3;
240
246 typedef detail::tvec3<int, mediump> mediump_ivec3;
247
253 typedef detail::tvec3<int, lowp> lowp_ivec3;
254
260 typedef detail::tvec3<uint, highp> highp_uvec3;
261
267 typedef detail::tvec3<uint, mediump> mediump_uvec3;
268
274 typedef detail::tvec3<uint, lowp> lowp_uvec3;
275
280 typedef detail::tvec3<bool, highp> highp_bvec3;
281
286 typedef detail::tvec3<bool, mediump> mediump_bvec3;
287
292 typedef detail::tvec3<bool, lowp> lowp_bvec3;
293
295
298
303 typedef detail::tvec4<float, highp> highp_vec4;
304
309 typedef detail::tvec4<float, mediump> mediump_vec4;
310
315 typedef detail::tvec4<float, lowp> lowp_vec4;
316
321 typedef detail::tvec4<double, highp> highp_dvec4;
322
327 typedef detail::tvec4<double, mediump> mediump_dvec4;
328
333 typedef detail::tvec4<double, lowp> lowp_dvec4;
334
339 typedef detail::tvec4<int, highp> highp_ivec4;
340
345 typedef detail::tvec4<int, mediump> mediump_ivec4;
346
351 typedef detail::tvec4<int, lowp> lowp_ivec4;
352
357 typedef detail::tvec4<uint, highp> highp_uvec4;
358
363 typedef detail::tvec4<uint, mediump> mediump_uvec4;
364
369 typedef detail::tvec4<uint, lowp> lowp_uvec4;
370
375 typedef detail::tvec4<bool, highp> highp_bvec4;
376
381 typedef detail::tvec4<bool, mediump> mediump_bvec4;
382
387 typedef detail::tvec4<bool, lowp> lowp_bvec4;
388
390
393
395 // Default float definition
396
397 #if(defined(GLM_PRECISION_LOWP_FLOAT))
398 typedef lowp_vec2 vec2;
399 typedef lowp_vec3 vec3;
400 typedef lowp_vec4 vec4;
401 #elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
402 typedef mediump_vec2 vec2;
403 typedef mediump_vec3 vec3;
404 typedef mediump_vec4 vec4;
405 #else //defined(GLM_PRECISION_HIGHP_FLOAT)
406 typedef highp_vec2 vec2;
410
414 typedef highp_vec3 vec3;
415
419 typedef highp_vec4 vec4;
420 #endif//GLM_PRECISION
421
423 // Default double definition
424
425 #if(defined(GLM_PRECISION_LOWP_DOUBLE))
426 typedef lowp_dvec2 dvec2;
427 typedef lowp_dvec3 dvec3;
428 typedef lowp_dvec4 dvec4;
429 #elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE))
430 typedef mediump_dvec2 dvec2;
431 typedef mediump_dvec3 dvec3;
432 typedef mediump_dvec4 dvec4;
433 #else //defined(GLM_PRECISION_HIGHP_DOUBLE)
434 typedef highp_dvec2 dvec2;
438
442 typedef highp_dvec3 dvec3;
443
447 typedef highp_dvec4 dvec4;
448 #endif//GLM_PRECISION
449
451 // Signed integer definition
452
453 #if(defined(GLM_PRECISION_LOWP_INT))
454 typedef lowp_ivec2 ivec2;
455 typedef lowp_ivec3 ivec3;
456 typedef lowp_ivec4 ivec4;
457 #elif(defined(GLM_PRECISION_MEDIUMP_INT))
458 typedef mediump_ivec2 ivec2;
459 typedef mediump_ivec3 ivec3;
460 typedef mediump_ivec4 ivec4;
461 #else //defined(GLM_PRECISION_HIGHP_INT)
462 typedef highp_ivec2 ivec2;
466
470 typedef highp_ivec3 ivec3;
471
475 typedef highp_ivec4 ivec4;
476 #endif//GLM_PRECISION
477
479 // Unsigned integer definition
480
481 #if(defined(GLM_PRECISION_LOWP_UINT))
482 typedef lowp_uvec2 uvec2;
483 typedef lowp_uvec3 uvec3;
484 typedef lowp_uvec4 uvec4;
485 #elif(defined(GLM_PRECISION_MEDIUMP_UINT))
486 typedef mediump_uvec2 uvec2;
487 typedef mediump_uvec3 uvec3;
488 typedef mediump_uvec4 uvec4;
489 #else //defined(GLM_PRECISION_HIGHP_UINT)
490 typedef highp_uvec2 uvec2;
494
498 typedef highp_uvec3 uvec3;
499
503 typedef highp_uvec4 uvec4;
504 #endif//GLM_PRECISION
505
507 // Boolean definition
508
509 #if(defined(GLM_PRECISION_LOWP_BOOL))
510 typedef lowp_bvec2 bvec2;
511 typedef lowp_bvec3 bvec3;
512 typedef lowp_bvec4 bvec4;
513 #elif(defined(GLM_PRECISION_MEDIUMP_BOOL))
514 typedef mediump_bvec2 bvec2;
515 typedef mediump_bvec3 bvec3;
516 typedef mediump_bvec4 bvec4;
517 #else //defined(GLM_PRECISION_HIGHP_BOOL)
518 typedef highp_bvec2 bvec2;
522
526 typedef highp_bvec3 bvec3;
527
531 typedef highp_bvec4 bvec4;
532 #endif//GLM_PRECISION
533
535 }//namespace glm
536
537 #endif//glm_core_type_vec
glm::ivec4
highp_ivec4 ivec4
4 components vector of signed integer numbers.
Definition: type_vec.hpp:475
glm::highp_bvec4
detail::tvec4< bool, highp > highp_bvec4
4 components vector of high precision bool numbers.
Definition: type_vec.hpp:375
glm::highp_uvec2
detail::tvec2< uint, highp > highp_uvec2
2 components vector of high precision unsigned integer numbers.
Definition: type_vec.hpp:149
glm::highp_uvec4
detail::tvec4< uint, highp > highp_uvec4
4 components vector of high precision unsigned integer numbers.
Definition: type_vec.hpp:357
glm::bvec3
highp_bvec3 bvec3
3 components vector of boolean.
Definition: type_vec.hpp:526
glm::mediump_ivec3
detail::tvec3< int, mediump > mediump_ivec3
3 components vector of medium precision signed integer numbers.
Definition: type_vec.hpp:246
glm::bvec2
highp_bvec2 bvec2
2 components vector of boolean.
Definition: type_vec.hpp:521
glm::vec3
highp_vec3 vec3
3 components vector of floating-point numbers.
Definition: type_vec.hpp:414
glm::dvec3
highp_dvec3 dvec3
3 components vector of double-precision floating-point numbers.
Definition: type_vec.hpp:442
glm::mediump_ivec2
detail::tvec2< int, mediump > mediump_ivec2
2 components vector of medium precision signed integer numbers.
Definition: type_vec.hpp:135
glm::lowp_dvec4
detail::tvec4< double, lowp > lowp_dvec4
4 components vector of low double-precision floating-point numbers.
Definition: type_vec.hpp:333
glm::ivec2
highp_ivec2 ivec2
2 components vector of signed integer numbers.
Definition: type_vec.hpp:465
glm::lowp_uvec2
detail::tvec2< uint, lowp > lowp_uvec2
2 components vector of low precision unsigned integer numbers.
Definition: type_vec.hpp:163
glm::vec4
highp_vec4 vec4
4 components vector of floating-point numbers.
Definition: type_vec.hpp:419
glm::mediump_vec4
detail::tvec4< float, mediump > mediump_vec4
4 components vector of medium single-precision floating-point numbers.
Definition: type_vec.hpp:309
glm::mediump_bvec2
detail::tvec2< bool, mediump > mediump_bvec2
2 components vector of medium precision bool numbers.
Definition: type_vec.hpp:177
glm::lowp_bvec4
detail::tvec4< bool, lowp > lowp_bvec4
4 components vector of low precision bool numbers.
Definition: type_vec.hpp:387
glm::lowp_uvec3
detail::tvec3< uint, lowp > lowp_uvec3
3 components vector of low precision unsigned integer numbers.
Definition: type_vec.hpp:274
glm::lowp_vec3
detail::tvec3< float, lowp > lowp_vec3
3 components vector of low single-precision floating-point numbers.
Definition: type_vec.hpp:211
glm::lowp_ivec4
detail::tvec4< int, lowp > lowp_ivec4
4 components vector of low precision signed integer numbers.
Definition: type_vec.hpp:351
glm::highp_bvec2
detail::tvec2< bool, highp > highp_bvec2
2 components vector of high precision bool numbers.
Definition: type_vec.hpp:170
glm::highp_dvec4
detail::tvec4< double, highp > highp_dvec4
4 components vector of high double-precision floating-point numbers.
Definition: type_vec.hpp:321
glm::lowp_uvec4
detail::tvec4< uint, lowp > lowp_uvec4
4 components vector of low precision unsigned integer numbers.
Definition: type_vec.hpp:369
glm::highp_vec3
detail::tvec3< float, highp > highp_vec3
3 components vector of high single-precision floating-point numbers.
Definition: type_vec.hpp:197
glm::dvec2
highp_dvec2 dvec2
2 components vector of double-precision floating-point numbers.
Definition: type_vec.hpp:437
glm::mediump_bvec3
detail::tvec3< bool, mediump > mediump_bvec3
3 components vector of medium precision bool numbers.
Definition: type_vec.hpp:286
glm::mediump_dvec4
detail::tvec4< double, mediump > mediump_dvec4
4 components vector of medium double-precision floating-point numbers.
Definition: type_vec.hpp:327
glm::highp_dvec2
detail::tvec2< double, highp > highp_dvec2
2 components vector of high double-precision floating-point numbers.
Definition: type_vec.hpp:107
glm::highp_uvec3
detail::tvec3< uint, highp > highp_uvec3
3 components vector of high precision unsigned integer numbers.
Definition: type_vec.hpp:260
glm::ivec3
highp_ivec3 ivec3
3 components vector of signed integer numbers.
Definition: type_vec.hpp:470
glm::mediump_uvec3
detail::tvec3< uint, mediump > mediump_uvec3
3 components vector of medium precision unsigned integer numbers.
Definition: type_vec.hpp:267
glm::mediump_bvec4
detail::tvec4< bool, mediump > mediump_bvec4
4 components vector of medium precision bool numbers.
Definition: type_vec.hpp:381
glm::lowp_bvec3
detail::tvec3< bool, lowp > lowp_bvec3
3 components vector of low precision bool numbers.
Definition: type_vec.hpp:292
glm::highp_dvec3
detail::tvec3< double, highp > highp_dvec3
3 components vector of high double-precision floating-point numbers.
Definition: type_vec.hpp:218
glm::uvec3
highp_uvec3 uvec3
3 components vector of unsigned integer numbers.
Definition: type_vec.hpp:498
glm::dvec4
highp_dvec4 dvec4
4 components vector of double-precision floating-point numbers.
Definition: type_vec.hpp:447
glm::mediump_uvec2
detail::tvec2< uint, mediump > mediump_uvec2
2 components vector of medium precision unsigned integer numbers.
Definition: type_vec.hpp:156
glm::lowp_ivec2
detail::tvec2< int, lowp > lowp_ivec2
2 components vector of low precision signed integer numbers.
Definition: type_vec.hpp:142
glm::lowp_bvec2
detail::tvec2< bool, lowp > lowp_bvec2
2 components vector of low precision bool numbers.
Definition: type_vec.hpp:184
glm::mediump_ivec4
detail::tvec4< int, mediump > mediump_ivec4
4 components vector of medium precision signed integer numbers.
Definition: type_vec.hpp:345
glm::lowp_dvec2
detail::tvec2< double, lowp > lowp_dvec2
2 components vector of low double-precision floating-point numbers.
Definition: type_vec.hpp:121
glm::highp_vec2
detail::tvec2< float, highp > highp_vec2
2 components vector of high single-precision floating-point numbers.
Definition: type_vec.hpp:86
glm::mediump_dvec3
detail::tvec3< double, mediump > mediump_dvec3
3 components vector of medium double-precision floating-point numbers.
Definition: type_vec.hpp:225
glm::lowp_dvec3
detail::tvec3< double, lowp > lowp_dvec3
3 components vector of low double-precision floating-point numbers.
Definition: type_vec.hpp:232
glm::lowp_vec2
detail::tvec2< float, lowp > lowp_vec2
2 components vector of low single-precision floating-point numbers.
Definition: type_vec.hpp:100
glm::mediump_dvec2
detail::tvec2< double, mediump > mediump_dvec2
2 components vector of medium double-precision floating-point numbers.
Definition: type_vec.hpp:114
glm::uvec4
highp_uvec4 uvec4
4 components vector of unsigned integer numbers.
Definition: type_vec.hpp:503
glm::lowp_ivec3
detail::tvec3< int, lowp > lowp_ivec3
3 components vector of low precision signed integer numbers.
Definition: type_vec.hpp:253
glm::uvec2
highp_uvec2 uvec2
2 components vector of unsigned integer numbers.
Definition: type_vec.hpp:493
glm::bvec4
highp_bvec4 bvec4
4 components vector of boolean.
Definition: type_vec.hpp:531
glm::highp_ivec2
detail::tvec2< int, highp > highp_ivec2
2 components vector of high precision signed integer numbers.
Definition: type_vec.hpp:128
glm::lowp_vec4
detail::tvec4< float, lowp > lowp_vec4
4 components vector of low single-precision floating-point numbers.
Definition: type_vec.hpp:315
glm::mediump_vec2
detail::tvec2< float, mediump > mediump_vec2
2 components vector of medium single-precision floating-point numbers.
Definition: type_vec.hpp:93
glm::vec2
highp_vec2 vec2
2 components vector of floating-point numbers.
Definition: type_vec.hpp:409
glm::highp_ivec3
detail::tvec3< int, highp > highp_ivec3
3 components vector of high precision signed integer numbers.
Definition: type_vec.hpp:239
glm::highp_bvec3
detail::tvec3< bool, highp > highp_bvec3
3 components vector of high precision bool numbers.
Definition: type_vec.hpp:280
glm::highp_vec4
detail::tvec4< float, highp > highp_vec4
4 components vector of high single-precision floating-point numbers.
Definition: type_vec.hpp:303
glm::highp_ivec4
detail::tvec4< int, highp > highp_ivec4
4 components vector of high precision signed integer numbers.
Definition: type_vec.hpp:339
glm::mediump_uvec4
detail::tvec4< uint, mediump > mediump_uvec4
4 components vector of medium precision unsigned integer numbers.
Definition: type_vec.hpp:363
glm::mediump_vec3
detail::tvec3< float, mediump > mediump_vec3
3 components vector of medium single-precision floating-point numbers.
Definition: type_vec.hpp:204