- Main Page
- Related Pages
- Modules
- Files

- File List

type_mat2x2.hpp
Go to the documentation of this file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #ifndef glm_core_type_mat2x2
30 #define glm_core_type_mat2x2
31
32 #include "type_mat.hpp"
33
34 namespace glm{
35 namespace detail
36 {
37 template <typename T> struct tvec1;
38 template <typename T> struct tvec2;
39 template <typename T> struct tvec3;
40 template <typename T> struct tvec4;
41 template <typename T> struct tmat2x2;
42 template <typename T> struct tmat2x3;
43 template <typename T> struct tmat2x4;
44 template <typename T> struct tmat3x2;
45 template <typename T> struct tmat3x3;
46 template <typename T> struct tmat3x4;
47 template <typename T> struct tmat4x2;
48 template <typename T> struct tmat4x3;
49 template <typename T> struct tmat4x4;
50
51 template <typename T>
52 struct tmat2x2
53 {
54 // Implementation detail
55 enum ctor{null};
56 typedef T value_type;
57 typedef std::size_t size_type;
58 typedef tvec2<T> col_type;
59 typedef tvec2<T> row_type;
60 typedef tmat2x2<T> type;
61 typedef tmat2x2<T> transpose_type;
62
63 static GLM_FUNC_DECL size_type col_size();
64 static GLM_FUNC_DECL size_type row_size();
65
66 GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
67
68 public:
69 // Implementation detail
70 GLM_FUNC_DECL tmat2x2<T> _inverse() const;
71
72 private:
74 // Implementation detail
75 col_type value[2];
76
77 public:
79 // Constructors
80 GLM_FUNC_DECL tmat2x2();
81 GLM_FUNC_DECL tmat2x2(
82 tmat2x2 const & m);
83
84 GLM_FUNC_DECL explicit tmat2x2(
85 ctor Null);
86 GLM_FUNC_DECL explicit tmat2x2(
87 value_type const & x);
88 GLM_FUNC_DECL explicit tmat2x2(
89 value_type const & x1, value_type const & y1,
90 value_type const & x2, value_type const & y2);
91 GLM_FUNC_DECL explicit tmat2x2(
92 col_type const & v1,
93 col_type const & v2);
94
96 // Conversions
97 template <typename U>
98 GLM_FUNC_DECL explicit tmat2x2(
99 U const & x);
100
101 template <typename U, typename V, typename M, typename N>
102 GLM_FUNC_DECL explicit tmat2x2(
103 U const & x1, V const & y1,
104 M const & x2, N const & y2);
105
106 template <typename U, typename V>
107 GLM_FUNC_DECL explicit tmat2x2(
108 tvec2<U> const & v1,
109 tvec2<V> const & v2);
110
112 // Matrix conversions
113 template <typename U>
114 GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U> const & m);
115
116 GLM_FUNC_DECL explicit tmat2x2(tmat3x3<T> const & x);
117 GLM_FUNC_DECL explicit tmat2x2(tmat4x4<T> const & x);
118 GLM_FUNC_DECL explicit tmat2x2(tmat2x3<T> const & x);
119 GLM_FUNC_DECL explicit tmat2x2(tmat3x2<T> const & x);
120 GLM_FUNC_DECL explicit tmat2x2(tmat2x4<T> const & x);
121 GLM_FUNC_DECL explicit tmat2x2(tmat4x2<T> const & x);
122 GLM_FUNC_DECL explicit tmat2x2(tmat3x4<T> const & x);
123 GLM_FUNC_DECL explicit tmat2x2(tmat4x3<T> const & x);
124
126 // Accesses
127
128 GLM_FUNC_DECL col_type & operator[](size_type i);
129 GLM_FUNC_DECL col_type const & operator[](size_type i) const;
130
131 // Unary updatable operators
132 GLM_FUNC_DECL tmat2x2<T> & operator=(tmat2x2<T> const & m);
133 template <typename U>
134 GLM_FUNC_DECL tmat2x2<T> & operator=(tmat2x2<U> const & m);
135 template <typename U>
136 GLM_FUNC_DECL tmat2x2<T> & operator+=(U const & s);
137 template <typename U>
138 GLM_FUNC_DECL tmat2x2<T> & operator+=(tmat2x2<U> const & m);
139 template <typename U>
140 GLM_FUNC_DECL tmat2x2<T> & operator-=(U const & s);
141 template <typename U>
142 GLM_FUNC_DECL tmat2x2<T> & operator-=(tmat2x2<U> const & m);
143 template <typename U>
144 GLM_FUNC_DECL tmat2x2<T> & operator*=(U const & s);
145 template <typename U>
146 GLM_FUNC_DECL tmat2x2<T> & operator*=(tmat2x2<U> const & m);
147 template <typename U>
148 GLM_FUNC_DECL tmat2x2<T> & operator/=(U const & s);
149 template <typename U>
150 GLM_FUNC_DECL tmat2x2<T> & operator/=(tmat2x2<U> const & m);
151 GLM_FUNC_DECL tmat2x2<T> & operator++();
152 GLM_FUNC_DECL tmat2x2<T> & operator--();
153 };
154
155 // Binary operators
156 template <typename T>
157 tmat2x2<T> operator+ (
158 tmat2x2<T> const & m,
159 typename tmat2x2<T>::value_type const & s);
160
161 template <typename T>
162 tmat2x2<T> operator+ (
163 typename tmat2x2<T>::value_type const & s,
164 tmat2x2<T> const & m);
165
166 template <typename T>
167 tmat2x2<T> operator+ (
168 tmat2x2<T> const & m1,
169 tmat2x2<T> const & m2);
170
171 template <typename T>
172 tmat2x2<T> operator- (
173 tmat2x2<T> const & m,
174 typename tmat2x2<T>::value_type const & s);
175
176 template <typename T>
177 tmat2x2<T> operator- (
178 typename tmat2x2<T>::value_type const & s,
179 tmat2x2<T> const & m);
180
181 template <typename T>
182 tmat2x2<T> operator- (
183 tmat2x2<T> const & m1,
184 tmat2x2<T> const & m2);
185
186 template <typename T>
187 tmat2x2<T> operator* (
188 tmat2x2<T> const & m,
189 typename tmat2x2<T>::value_type const & s);
190
191 template <typename T>
192 tmat2x2<T> operator* (
193 typename tmat2x2<T>::value_type const & s,
194 tmat2x2<T> const & m);
195
196 template <typename T>
197 typename tmat2x2<T>::col_type operator* (
198 tmat2x2<T> const & m,
199 typename tmat2x2<T>::row_type const & v);
200
201 template <typename T>
202 typename tmat2x2<T>::row_type operator* (
203 typename tmat2x2<T>::col_type const & v,
204 tmat2x2<T> const & m);
205
206 template <typename T>
207 tmat2x2<T> operator* (
208 tmat2x2<T> const & m1,
209 tmat2x2<T> const & m2);
210
211 template <typename T>
212 tmat3x2<T> operator* (
213 tmat2x2<T> const & m1,
214 tmat3x2<T> const & m2);
215
216 template <typename T>
217 tmat4x2<T> operator* (
218 tmat2x2<T> const & m1,
219 tmat4x2<T> const & m2);
220
221 template <typename T>
222 tmat2x2<T> operator/ (
223 tmat2x2<T> const & m,
224 typename tmat2x2<T>::value_type const & s);
225
226 template <typename T>
227 tmat2x2<T> operator/ (
228 typename tmat2x2<T>::value_type const & s,
229 tmat2x2<T> const & m);
230
231 template <typename T>
232 typename tmat2x2<T>::col_type operator/ (
233 tmat2x2<T> const & m,
234 typename tmat2x2<T>::row_type const & v);
235
236 template <typename T>
237 typename tmat2x2<T>::row_type operator/ (
238 typename tmat2x2<T>::col_type const & v,
239 tmat2x2<T> const & m);
240
241 template <typename T>
242 tmat2x2<T> operator/ (
243 tmat2x2<T> const & m1,
244 tmat2x2<T> const & m2);
245
246 // Unary constant operators
247 template <typename T>
248 tmat2x2<T> const operator- (
249 tmat2x2<T> const & m);
250
251 template <typename T>
252 tmat2x2<T> const operator-- (
253 tmat2x2<T> const & m,
254 int);
255
256 template <typename T>
257 tmat2x2<T> const operator++ (
258 tmat2x2<T> const & m,
259 int);
260 } //namespace detail
261
264
270 typedef detail::tmat2x2<lowp_float> lowp_mat2;
271
277 typedef detail::tmat2x2<mediump_float> mediump_mat2;
278
284 typedef detail::tmat2x2<highp_float> highp_mat2;
285
291 typedef detail::tmat2x2<lowp_float> lowp_mat2x2;
292
298 typedef detail::tmat2x2<mediump_float> mediump_mat2x2;
299
305 typedef detail::tmat2x2<highp_float> highp_mat2x2;
306
308 }//namespace glm
309
310 #ifndef GLM_EXTERNAL_TEMPLATE
311 #include "type_mat2x2.inl"
312 #endif
313
314 #endif //glm_core_type_mat2x2