- Main Page
- Related Pages
- Modules
- Files

- File List

type_mat4x4.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_mat4x4
30 #define glm_core_type_mat4x4
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 tmat4x4
53 {
54 enum ctor{null};
55 typedef T value_type;
56 typedef std::size_t size_type;
57 typedef tvec4<T> col_type;
58 typedef tvec4<T> row_type;
59 typedef tmat4x4<T> type;
60 typedef tmat4x4<T> transpose_type;
61
62 static GLM_FUNC_DECL size_type col_size();
63 static GLM_FUNC_DECL size_type row_size();
64
65 GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
66
67 public:
70 GLM_FUNC_DECL tmat4x4<T> _inverse() const;
72
73 private:
74 // Data
75 col_type value[4];
76
77 public:
78 // Constructors
79 GLM_FUNC_DECL tmat4x4();
80 GLM_FUNC_DECL tmat4x4(tmat4x4 const & m);
81
82 GLM_FUNC_DECL explicit tmat4x4(
83 ctor Null);
84 GLM_FUNC_DECL explicit tmat4x4(
85 value_type const & x);
86 GLM_FUNC_DECL explicit tmat4x4(
87 value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0,
88 value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1,
89 value_type const & x2, value_type const & y2, value_type const & z2, value_type const & w2,
90 value_type const & x3, value_type const & y3, value_type const & z3, value_type const & w3);
91 GLM_FUNC_DECL explicit tmat4x4(
92 col_type const & v0,
93 col_type const & v1,
94 col_type const & v2,
95 col_type const & v3);
96
98 // Conversions
99 template <typename U>
100 GLM_FUNC_DECL explicit tmat4x4(
101 U const & x);
102
103 template <
104 typename X1, typename Y1, typename Z1, typename W1,
105 typename X2, typename Y2, typename Z2, typename W2,
106 typename X3, typename Y3, typename Z3, typename W3,
107 typename X4, typename Y4, typename Z4, typename W4>
108 GLM_FUNC_DECL explicit tmat4x4(
109 X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
110 X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
111 X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3,
112 X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4);
113
114 template <typename V1, typename V2, typename V3, typename V4>
115 GLM_FUNC_DECL explicit tmat4x4(
116 tvec4<V1> const & v1,
117 tvec4<V2> const & v2,
118 tvec4<V3> const & v3,
119 tvec4<V4> const & v4);
120
121 // Matrix conversions
122 template <typename U>
123 GLM_FUNC_DECL explicit tmat4x4(tmat4x4<U> const & m);
124
125 GLM_FUNC_DECL explicit tmat4x4(tmat2x2<T> const & x);
126 GLM_FUNC_DECL explicit tmat4x4(tmat3x3<T> const & x);
127 GLM_FUNC_DECL explicit tmat4x4(tmat2x3<T> const & x);
128 GLM_FUNC_DECL explicit tmat4x4(tmat3x2<T> const & x);
129 GLM_FUNC_DECL explicit tmat4x4(tmat2x4<T> const & x);
130 GLM_FUNC_DECL explicit tmat4x4(tmat4x2<T> const & x);
131 GLM_FUNC_DECL explicit tmat4x4(tmat3x4<T> const & x);
132 GLM_FUNC_DECL explicit tmat4x4(tmat4x3<T> const & x);
133
134 // Accesses
135 GLM_FUNC_DECL col_type & operator[](size_type i);
136 GLM_FUNC_DECL col_type const & operator[](size_type i) const;
137
138 // Unary updatable operators
139 GLM_FUNC_DECL tmat4x4<T> & operator= (tmat4x4<T> const & m);
140 template <typename U>
141 GLM_FUNC_DECL tmat4x4<T> & operator= (tmat4x4<U> const & m);
142 template <typename U>
143 GLM_FUNC_DECL tmat4x4<T> & operator+= (U const & s);
144 template <typename U>
145 GLM_FUNC_DECL tmat4x4<T> & operator+= (tmat4x4<U> const & m);
146 template <typename U>
147 GLM_FUNC_DECL tmat4x4<T> & operator-= (U const & s);
148 template <typename U>
149 GLM_FUNC_DECL tmat4x4<T> & operator-= (tmat4x4<U> const & m);
150 template <typename U>
151 GLM_FUNC_DECL tmat4x4<T> & operator*= (U const & s);
152 template <typename U>
153 GLM_FUNC_DECL tmat4x4<T> & operator*= (tmat4x4<U> const & m);
154 template <typename U>
155 GLM_FUNC_DECL tmat4x4<T> & operator/= (U const & s);
156 template <typename U>
157 GLM_FUNC_DECL tmat4x4<T> & operator/= (tmat4x4<U> const & m);
158 GLM_FUNC_DECL tmat4x4<T> & operator++ ();
159 GLM_FUNC_DECL tmat4x4<T> & operator-- ();
160 };
161
162 // Binary operators
163 template <typename T>
164 tmat4x4<T> operator+ (
165 tmat4x4<T> const & m,
166 typename tmat4x4<T>::value_type const & s);
167
168 template <typename T>
169 tmat4x4<T> operator+ (
170 typename tmat4x4<T>::value_type const & s,
171 tmat4x4<T> const & m);
172
173 template <typename T>
174 tmat4x4<T> operator+ (
175 tmat4x4<T> const & m1,
176 tmat4x4<T> const & m2);
177
178 template <typename T>
179 tmat4x4<T> operator- (
180 tmat4x4<T> const & m,
181 typename tmat4x4<T>::value_type const & s);
182
183 template <typename T>
184 tmat4x4<T> operator- (
185 typename tmat4x4<T>::value_type const & s,
186 tmat4x4<T> const & m);
187
188 template <typename T>
189 tmat4x4<T> operator- (
190 tmat4x4<T> const & m1,
191 tmat4x4<T> const & m2);
192
193 template <typename T>
194 tmat4x4<T> operator* (
195 tmat4x4<T> const & m,
196 typename tmat4x4<T>::value_type const & s);
197
198 template <typename T>
199 tmat4x4<T> operator* (
200 typename tmat4x4<T>::value_type const & s,
201 tmat4x4<T> const & m);
202
203 template <typename T>
204 typename tmat4x4<T>::col_type operator* (
205 tmat4x4<T> const & m,
206 typename tmat4x4<T>::row_type const & v);
207
208 template <typename T>
209 typename tmat4x4<T>::row_type operator* (
210 typename tmat4x4<T>::col_type const & v,
211 tmat4x4<T> const & m);
212
213 template <typename T>
214 tmat2x4<T> operator* (
215 tmat4x4<T> const & m1,
216 tmat2x4<T> const & m2);
217
218 template <typename T>
219 tmat3x4<T> operator* (
220 tmat4x4<T> const & m1,
221 tmat3x4<T> const & m2);
222
223 template <typename T>
224 tmat4x4<T> operator* (
225 tmat4x4<T> const & m1,
226 tmat4x4<T> const & m2);
227
228 template <typename T>
229 tmat4x4<T> operator/ (
230 tmat4x4<T> const & m,
231 typename tmat4x4<T>::value_type const & s);
232
233 template <typename T>
234 tmat4x4<T> operator/ (
235 typename tmat4x4<T>::value_type const & s,
236 tmat4x4<T> const & m);
237
238 template <typename T>
239 typename tmat4x4<T>::col_type operator/ (
240 tmat4x4<T> const & m,
241 typename tmat4x4<T>::row_type const & v);
242
243 template <typename T>
244 typename tmat4x4<T>::row_type operator/ (
245 typename tmat4x4<T>::col_type & v,
246 tmat4x4<T> const & m);
247
248 template <typename T>
249 tmat4x4<T> operator/ (
250 tmat4x4<T> const & m1,
251 tmat4x4<T> const & m2);
252
253 // Unary constant operators
254 template <typename T>
255 tmat4x4<T> const operator- (
256 tmat4x4<T> const & m);
257
258 template <typename T>
259 tmat4x4<T> const operator-- (
260 tmat4x4<T> const & m, int);
261
262 template <typename T>
263 tmat4x4<T> const operator++ (
264 tmat4x4<T> const & m, int);
265
266 } //namespace detail
267
270
276 typedef detail::tmat4x4<lowp_float> lowp_mat4;
277
283 typedef detail::tmat4x4<mediump_float> mediump_mat4;
284
290 typedef detail::tmat4x4<highp_float> highp_mat4;
291
297 typedef detail::tmat4x4<lowp_float> lowp_mat4x4;
298
304 typedef detail::tmat4x4<mediump_float> mediump_mat4x4;
305
311 typedef detail::tmat4x4<highp_float> highp_mat4x4;
312
314 }//namespace glm
315
316 #ifndef GLM_EXTERNAL_TEMPLATE
317 #include "type_mat4x4.inl"
318 #endif//GLM_EXTERNAL_TEMPLATE
319
320 #endif//glm_core_type_mat4x4