0.9.9 API documenation: type_trait.hpp Source File

| 0.9.9 API documenation

- Main Page
- Modules
- Files

- File List

type_trait.hpp
Go to the documentation of this file.
1
13 #pragma once
14
15 #ifndef GLM_ENABLE_EXPERIMENTAL
16 # error "GLM: GLM_GTX_type_trait is an experimetal extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
17 #endif
18
19 // Dependency:
20 #include "../detail/type_vec2.hpp"
21 #include "../detail/type_vec3.hpp"
22 #include "../detail/type_vec4.hpp"
23 #include "../detail/type_mat2x2.hpp"
24 #include "../detail/type_mat2x3.hpp"
25 #include "../detail/type_mat2x4.hpp"
26 #include "../detail/type_mat3x2.hpp"
27 #include "../detail/type_mat3x3.hpp"
28 #include "../detail/type_mat3x4.hpp"
29 #include "../detail/type_mat4x2.hpp"
30 #include "../detail/type_mat4x3.hpp"
31 #include "../detail/type_mat4x4.hpp"
32 #include "../gtc/quaternion.hpp"
33 #include "../gtx/dual_quaternion.hpp"
34
35 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
36 # pragma message("GLM: GLM_GTX_type_trait extension included")
37 #endif
38
39 namespace glm
40 {
43
44 template <template <typename, precision> class genType, typename T, precision P>
45 struct type
46 {
47 static bool const is_vec = false;
48 static bool const is_mat = false;
49 static bool const is_quat = false;
50 static length_t const components = 0;
51 static length_t const cols = 0;
52 static length_t const rows = 0;
53 };
54
55 template <typename T, precision P>
56 struct type<tvec1, T, P>
57 {
58 static bool const is_vec = true;
59 static bool const is_mat = false;
60 static bool const is_quat = false;
61 enum
62 {
63 components = 1
64 };
65 };
66
67 template <typename T, precision P>
68 struct type<tvec2, T, P>
69 {
70 static bool const is_vec = true;
71 static bool const is_mat = false;
72 static bool const is_quat = false;
73 enum
74 {
75 components = 2
76 };
77 };
78
79 template <typename T, precision P>
80 struct type<tvec3, T, P>
81 {
82 static bool const is_vec = true;
83 static bool const is_mat = false;
84 static bool const is_quat = false;
85 enum
86 {
87 components = 3
88 };
89 };
90
91 template <typename T, precision P>
92 struct type<tvec4, T, P>
93 {
94 static bool const is_vec = true;
95 static bool const is_mat = false;
96 static bool const is_quat = false;
97 enum
98 {
99 components = 4
100 };
101 };
102
103 template <typename T, precision P>
104 struct type<tmat2x2, T, P>
105 {
106 static bool const is_vec = false;
107 static bool const is_mat = true;
108 static bool const is_quat = false;
109 enum
110 {
111 components = 2,
112 cols = 2,
113 rows = 2
114 };
115 };
116
117 template <typename T, precision P>
118 struct type<tmat2x3, T, P>
119 {
120 static bool const is_vec = false;
121 static bool const is_mat = true;
122 static bool const is_quat = false;
123 enum
124 {
125 components = 2,
126 cols = 2,
127 rows = 3
128 };
129 };
130
131 template <typename T, precision P>
132 struct type<tmat2x4, T, P>
133 {
134 static bool const is_vec = false;
135 static bool const is_mat = true;
136 static bool const is_quat = false;
137 enum
138 {
139 components = 2,
140 cols = 2,
141 rows = 4
142 };
143 };
144
145 template <typename T, precision P>
146 struct type<tmat3x2, T, P>
147 {
148 static bool const is_vec = false;
149 static bool const is_mat = true;
150 static bool const is_quat = false;
151 enum
152 {
153 components = 3,
154 cols = 3,
155 rows = 2
156 };
157 };
158
159 template <typename T, precision P>
160 struct type<tmat3x3, T, P>
161 {
162 static bool const is_vec = false;
163 static bool const is_mat = true;
164 static bool const is_quat = false;
165 enum
166 {
167 components = 3,
168 cols = 3,
169 rows = 3
170 };
171 };
172
173 template <typename T, precision P>
174 struct type<tmat3x4, T, P>
175 {
176 static bool const is_vec = false;
177 static bool const is_mat = true;
178 static bool const is_quat = false;
179 enum
180 {
181 components = 3,
182 cols = 3,
183 rows = 4
184 };
185 };
186
187 template <typename T, precision P>
188 struct type<tmat4x2, T, P>
189 {
190 static bool const is_vec = false;
191 static bool const is_mat = true;
192 static bool const is_quat = false;
193 enum
194 {
195 components = 4,
196 cols = 4,
197 rows = 2
198 };
199 };
200
201 template <typename T, precision P>
202 struct type<tmat4x3, T, P>
203 {
204 static bool const is_vec = false;
205 static bool const is_mat = true;
206 static bool const is_quat = false;
207 enum
208 {
209 components = 4,
210 cols = 4,
211 rows = 3
212 };
213 };
214
215 template <typename T, precision P>
216 struct type<tmat4x4, T, P>
217 {
218 static bool const is_vec = false;
219 static bool const is_mat = true;
220 static bool const is_quat = false;
221 enum
222 {
223 components = 4,
224 cols = 4,
225 rows = 4
226 };
227 };
228
229 template <typename T, precision P>
230 struct type<tquat, T, P>
231 {
232 static bool const is_vec = false;
233 static bool const is_mat = false;
234 static bool const is_quat = true;
235 enum
236 {
237 components = 4
238 };
239 };
240
241 template <typename T, precision P>
242 struct type<tdualquat, T, P>
243 {
244 static bool const is_vec = false;
245 static bool const is_mat = false;
246 static bool const is_quat = true;
247 enum
248 {
249 components = 8
250 };
251 };
252
254 }//namespace glm
255
256 #include "type_trait.inl"
glm
Definition: _noise.hpp:11