1///////////////////////////////////////////////////////////////////////////////////
2/// OpenGL Mathematics (glm.g-truc.net)
3///
4/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
5/// Permission is hereby granted, free of charge, to any person obtaining a copy
6/// of this software and associated documentation files (the "Software"), to deal
7/// in the Software without restriction, including without limitation the rights
8/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9/// copies of the Software, and to permit persons to whom the Software is
10/// furnished to do so, subject to the following conditions:
11///
12/// The above copyright notice and this permission notice shall be included in
13/// all copies or substantial portions of the Software.
14///
15/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21/// THE SOFTWARE.
22///
23/// @ref core
24/// @file glm/core/type_mat4x3.inl
25/// @date 2006-04-17 / 2011-06-15
26/// @author Christophe Riccio
27///////////////////////////////////////////////////////////////////////////////////
28
29namespace glm{
30namespace detail
31{
32	template <typename T, precision P>
33	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat4x3<T, P>::length() const
34	{
35		return 4;
36	}
37
38	//////////////////////////////////////
39	// Accesses
40
41	template <typename T, precision P>
42	GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type &
43	tmat4x3<T, P>::operator[]
44	(
45		size_type i
46	)
47	{
48		assert(i < this->length());
49		return this->value[i];
50	}
51
52	template <typename T, precision P>
53	GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const &
54	tmat4x3<T, P>::operator[]
55	(
56		size_type i
57	) const
58	{
59		assert(i < this->length());
60		return this->value[i];
61	}
62
63	//////////////////////////////////////////////////////////////
64	// Constructors
65
66	template <typename T, precision P>
67	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3()
68	{
69		value_type const Zero(0);
70		value_type const One(1);
71		this->value[0] = col_type(One, Zero, Zero);
72		this->value[1] = col_type(Zero, One, Zero);
73		this->value[2] = col_type(Zero, Zero, One);
74		this->value[3] = col_type(Zero, Zero, Zero);
75	}
76
77	template <typename T, precision P>
78	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(
79		tmat4x3<T, P> const & m)
80	{
81		this->value[0] = m.value[0];
82		this->value[1] = m.value[1];
83		this->value[2] = m.value[2];
84		this->value[3] = m.value[3];
85	}
86
87	template <typename T, precision P>
88	template <precision Q>
89	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(
90		tmat4x3<T, Q> const & m)
91	{
92		this->value[0] = m.value[0];
93		this->value[1] = m.value[1];
94		this->value[2] = m.value[2];
95		this->value[3] = m.value[3];
96	}
97
98	template <typename T, precision P>
99	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(ctor)
100	{}
101
102	template <typename T, precision P>
103	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(
104		T const & s)
105	{
106		value_type const Zero(0);
107		this->value[0] = col_type(s, Zero, Zero);
108		this->value[1] = col_type(Zero, s, Zero);
109		this->value[2] = col_type(Zero, Zero, s);
110		this->value[3] = col_type(Zero, Zero, Zero);
111	}
112
113	template <typename T, precision P>
114	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
115	(
116		T const & x0, T const & y0, T const & z0,
117		T const & x1, T const & y1, T const & z1,
118		T const & x2, T const & y2, T const & z2,
119		T const & x3, T const & y3, T const & z3
120	)
121	{
122		this->value[0] = col_type(x0, y0, z0);
123		this->value[1] = col_type(x1, y1, z1);
124		this->value[2] = col_type(x2, y2, z2);
125		this->value[3] = col_type(x3, y3, z3);
126	}
127
128	template <typename T, precision P>
129	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
130	(
131		col_type const & v0,
132		col_type const & v1,
133		col_type const & v2,
134		col_type const & v3
135	)
136	{
137		this->value[0] = v0;
138		this->value[1] = v1;
139		this->value[2] = v2;
140		this->value[3] = v3;
141	}
142
143	//////////////////////////////////////
144	// Conversion constructors
145
146	template <typename T, precision P>
147	template <
148		typename X1, typename Y1, typename Z1,
149		typename X2, typename Y2, typename Z2,
150		typename X3, typename Y3, typename Z3,
151		typename X4, typename Y4, typename Z4>
152	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
153	(
154		X1 const & x1, Y1 const & y1, Z1 const & z1,
155		X2 const & x2, Y2 const & y2, Z2 const & z2,
156		X3 const & x3, Y3 const & y3, Z3 const & z3,
157		X4 const & x4, Y4 const & y4, Z4 const & z4
158	)
159	{
160		this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1));
161		this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2));
162		this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3));
163		this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4));
164	}
165
166	template <typename T, precision P>
167	template <typename V1, typename V2, typename V3, typename V4>
168	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
169	(
170		tvec3<V1, P> const & v1,
171		tvec3<V2, P> const & v2,
172		tvec3<V3, P> const & v3,
173		tvec3<V4, P> const & v4
174	)
175	{
176		this->value[0] = col_type(v1);
177		this->value[1] = col_type(v2);
178		this->value[2] = col_type(v3);
179		this->value[3] = col_type(v4);
180	}
181
182	//////////////////////////////////////////////////////////////
183	// Matrix conversions
184
185	template <typename T, precision P>
186	template <typename U, precision Q>
187	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
188	(
189		tmat4x3<U, Q> const & m
190	)
191	{
192		this->value[0] = col_type(m[0]);
193		this->value[1] = col_type(m[1]);
194		this->value[2] = col_type(m[2]);
195		this->value[3] = col_type(m[3]);
196	}
197
198	template <typename T, precision P>
199	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
200	(
201		tmat2x2<T, P> const & m
202	)
203	{
204		this->value[0] = col_type(m[0], value_type(0));
205		this->value[1] = col_type(m[1], value_type(0));
206		this->value[2] = col_type(m[2], value_type(1));
207		this->value[3] = col_type(static_cast<T>(0));
208	}
209
210	template <typename T, precision P>
211	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
212	(
213		tmat3x3<T, P> const & m
214	)
215	{
216		this->value[0] = col_type(m[0]);
217		this->value[1] = col_type(m[1]);
218		this->value[2] = col_type(m[2]);
219		this->value[3] = col_type(static_cast<T>(0));
220	}
221
222	template <typename T, precision P>
223	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
224	(
225		tmat4x4<T, P> const & m
226	)
227	{
228		this->value[0] = col_type(m[0]);
229		this->value[1] = col_type(m[1]);
230		this->value[2] = col_type(m[2]);
231		this->value[3] = col_type(m[3]);
232	}
233
234	template <typename T, precision P>
235	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
236	(
237		tmat2x3<T, P> const & m
238	)
239	{
240		this->value[0] = col_type(m[0]);
241		this->value[1] = col_type(m[1]);
242		this->value[2] = col_type(static_cast<T>(0), value_type(0), value_type(1));
243		this->value[3] = col_type(static_cast<T>(0));
244	}
245
246	template <typename T, precision P>
247	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
248	(
249		tmat3x2<T, P> const & m
250	)
251	{
252		this->value[0] = col_type(m[0], value_type(0));
253		this->value[1] = col_type(m[1], value_type(0));
254		this->value[2] = col_type(m[2], value_type(1));
255		this->value[3] = col_type(static_cast<T>(0));
256	}
257
258	template <typename T, precision P>
259	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
260	(
261		tmat2x4<T, P> const & m
262	)
263	{
264		this->value[0] = col_type(m[0]);
265		this->value[1] = col_type(m[1]);
266		this->value[2] = col_type(static_cast<T>(0), value_type(0), value_type(1));
267		this->value[3] = col_type(static_cast<T>(0));
268	}
269
270	template <typename T, precision P>
271	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
272	(
273		tmat4x2<T, P> const & m
274	)
275	{
276		this->value[0] = col_type(m[0], value_type(0));
277		this->value[1] = col_type(m[1], value_type(0));
278		this->value[2] = col_type(m[2], value_type(1));
279		this->value[3] = col_type(m[3], value_type(0));
280	}
281
282	template <typename T, precision P>
283	GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
284	(
285		tmat3x4<T, P> const & m
286	)
287	{
288		this->value[0] = col_type(m[0]);
289		this->value[1] = col_type(m[1]);
290		this->value[2] = col_type(m[2]);
291		this->value[3] = col_type(static_cast<T>(0));
292	}
293
294	//////////////////////////////////////////////////////////////
295	// Unary updatable operators
296
297	template <typename T, precision P>
298	GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=
299	(
300		tmat4x3<T, P> const & m
301	)
302	{
303		this->value[0] = m[0];
304		this->value[1] = m[1];
305		this->value[2] = m[2];
306		this->value[3] = m[3];
307		return *this;
308	}
309
310	template <typename T, precision P>
311	template <typename U>
312	GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=
313	(
314		tmat4x3<U, P> const & m
315	)
316	{
317		this->value[0] = m[0];
318		this->value[1] = m[1];
319		this->value[2] = m[2];
320		this->value[3] = m[3];
321		return *this;
322	}
323
324	template <typename T, precision P>
325	template <typename U>
326	GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator+= (U s)
327	{
328		this->value[0] += s;
329		this->value[1] += s;
330		this->value[2] += s;
331		this->value[3] += s;
332		return *this;
333	}
334
335	template <typename T, precision P>
336	template <typename U>
337	GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator+= (tmat4x3<U, P> const & m)
338	{
339		this->value[0] += m[0];
340		this->value[1] += m[1];
341		this->value[2] += m[2];
342		this->value[3] += m[3];
343		return *this;
344	}
345
346	template <typename T, precision P>
347	template <typename U>
348	GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-= (U s)
349	{
350		this->value[0] -= s;
351		this->value[1] -= s;
352		this->value[2] -= s;
353		this->value[3] -= s;
354		return *this;
355	}
356
357	template <typename T, precision P>
358	template <typename U>
359	GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-= (tmat4x3<U, P> const & m)
360	{
361		this->value[0] -= m[0];
362		this->value[1] -= m[1];
363		this->value[2] -= m[2];
364		this->value[3] -= m[3];
365		return *this;
366	}
367
368	template <typename T, precision P>
369	template <typename U>
370	GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator*= (U s)
371	{
372		this->value[0] *= s;
373		this->value[1] *= s;
374		this->value[2] *= s;
375		this->value[3] *= s;
376		return *this;
377	}
378
379	template <typename T, precision P>
380	template <typename U>
381	GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator/= (U s)
382	{
383		this->value[0] /= s;
384		this->value[1] /= s;
385		this->value[2] /= s;
386		this->value[3] /= s;
387		return *this;
388	}
389
390	template <typename T, precision P>
391	GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator++ ()
392	{
393		++this->value[0];
394		++this->value[1];
395		++this->value[2];
396		++this->value[3];
397		return *this;
398	}
399
400	template <typename T, precision P>
401	GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-- ()
402	{
403		--this->value[0];
404		--this->value[1];
405		--this->value[2];
406		--this->value[3];
407		return *this;
408	}
409
410	//////////////////////////////////////////////////////////////
411	// Binary operators
412
413	template <typename T, precision P>
414	GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+ (
415		tmat4x3<T, P> const & m,
416		T const & s)
417	{
418		return tmat4x3<T, P>(
419			m[0] + s,
420			m[1] + s,
421			m[2] + s,
422			m[3] + s);
423	}
424
425	template <typename T, precision P>
426	GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+ (
427		tmat4x3<T, P> const & m1,
428		tmat4x3<T, P> const & m2)
429	{
430		return tmat4x3<T, P>(
431			m1[0] + m2[0],
432			m1[1] + m2[1],
433			m1[2] + m2[2],
434			m1[3] + m2[3]);
435	}
436
437	template <typename T, precision P>
438	GLM_FUNC_QUALIFIER tmat4x3<T, P> operator- (
439		tmat4x3<T, P> const & m,
440		T const & s)
441	{
442		return tmat4x3<T, P>(
443			m[0] - s,
444			m[1] - s,
445			m[2] - s,
446			m[3] - s);
447	}
448
449	template <typename T, precision P>
450	GLM_FUNC_QUALIFIER tmat4x3<T, P> operator- (
451		tmat4x3<T, P> const & m1,
452		tmat4x3<T, P> const & m2)
453	{
454		return tmat4x3<T, P>(
455			m1[0] - m2[0],
456			m1[1] - m2[1],
457			m1[2] - m2[2],
458			m1[3] - m2[3]);
459	}
460
461	template <typename T, precision P>
462	GLM_FUNC_QUALIFIER tmat4x3<T, P> operator* (
463		tmat4x3<T, P> const & m,
464		T const & s)
465	{
466		return tmat4x3<T, P>(
467			m[0] * s,
468			m[1] * s,
469			m[2] * s,
470			m[3] * s);
471	}
472
473	template <typename T, precision P>
474	GLM_FUNC_QUALIFIER tmat4x3<T, P> operator* (
475		T const & s,
476		tmat4x3<T, P> const & m)
477	{
478		return tmat4x3<T, P>(
479			m[0] * s,
480			m[1] * s,
481			m[2] * s,
482			m[3] * s);
483	}
484
485	template <typename T, precision P>
486	GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type operator*
487	(
488		tmat4x3<T, P> const & m,
489		typename tmat4x3<T, P>::row_type const & v)
490	{
491		return typename tmat4x3<T, P>::col_type(
492			m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
493			m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w,
494			m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w);
495	}
496
497	template <typename T, precision P>
498	GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::row_type operator*
499	(
500		typename tmat4x3<T, P>::col_type const & v,
501		tmat4x3<T, P> const & m)
502	{
503		return typename tmat4x3<T, P>::row_type(
504			v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2],
505			v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2],
506			v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2],
507			v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]);
508	}
509
510	template <typename T, precision P>
511	GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*
512	(
513		tmat4x3<T, P> const & m1,
514		tmat2x4<T, P> const & m2
515	)
516	{
517		return tmat2x3<T, P>(
518			m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
519			m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
520			m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
521			m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
522			m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
523			m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3]);
524	}
525
526	template <typename T, precision P>
527	GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*
528	(
529		tmat4x3<T, P> const & m1,
530		tmat3x4<T, P> const & m2
531	)
532	{
533		T const SrcA00 = m1[0][0];
534		T const SrcA01 = m1[0][1];
535		T const SrcA02 = m1[0][2];
536		T const SrcA10 = m1[1][0];
537		T const SrcA11 = m1[1][1];
538		T const SrcA12 = m1[1][2];
539		T const SrcA20 = m1[2][0];
540		T const SrcA21 = m1[2][1];
541		T const SrcA22 = m1[2][2];
542		T const SrcA30 = m1[3][0];
543		T const SrcA31 = m1[3][1];
544		T const SrcA32 = m1[3][2];
545
546		T const SrcB00 = m2[0][0];
547		T const SrcB01 = m2[0][1];
548		T const SrcB02 = m2[0][2];
549		T const SrcB03 = m2[0][3];
550		T const SrcB10 = m2[1][0];
551		T const SrcB11 = m2[1][1];
552		T const SrcB12 = m2[1][2];
553		T const SrcB13 = m2[1][3];
554		T const SrcB20 = m2[2][0];
555		T const SrcB21 = m2[2][1];
556		T const SrcB22 = m2[2][2];
557		T const SrcB23 = m2[2][3];
558
559		tmat3x3<T, P> Result(tmat3x3<T, P>::_null);
560		Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;
561		Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;
562		Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03;
563		Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;
564		Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13;
565		Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13;
566		Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23;
567		Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23;
568		Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23;
569		return Result;
570	}
571
572	template <typename T, precision P>
573	GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*
574	(
575		tmat4x3<T, P> const & m1,
576		tmat4x4<T, P> const & m2
577	)
578	{
579		return tmat4x3<T, P>(
580			m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
581			m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
582			m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
583			m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
584			m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
585			m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3],
586			m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3],
587			m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3],
588			m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3],
589			m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3],
590			m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3],
591			m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]);
592	}
593
594	template <typename T, precision P>
595	GLM_FUNC_QUALIFIER tmat4x3<T, P> operator/
596	(
597		tmat4x3<T, P> const & m,
598		T const & s
599	)
600	{
601		return tmat4x3<T, P>(
602			m[0] / s,
603			m[1] / s,
604			m[2] / s,
605			m[3] / s);
606	}
607
608	template <typename T, precision P>
609	GLM_FUNC_QUALIFIER tmat4x3<T, P> operator/
610	(
611		T const & s,
612		tmat4x3<T, P> const & m
613	)
614	{
615		return tmat4x3<T, P>(
616			s / m[0],
617			s / m[1],
618			s / m[2],
619			s / m[3]);
620	}
621
622	// Unary constant operators
623	template <typename T, precision P>
624	GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator-
625	(
626		tmat4x3<T, P> const & m
627	)
628	{
629		return tmat4x3<T, P>(
630			-m[0],
631			-m[1],
632			-m[2],
633			-m[3]);
634	}
635
636	template <typename T, precision P>
637	GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator++
638	(
639		tmat4x3<T, P> const & m,
640		int
641	)
642	{
643		return tmat4x3<T, P>(
644			m[0] + T(1),
645			m[1] + T(1),
646			m[2] + T(1),
647			m[3] + T(1));
648	}
649
650	template <typename T, precision P>
651	GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator--
652	(
653		tmat4x3<T, P> const & m,
654		int
655	)
656	{
657		return tmat4x3<T, P>(
658			m[0] - T(1),
659			m[1] - T(1),
660			m[2] - T(1),
661			m[3] - T(1));
662	}
663
664	template <typename T, precision P>
665	GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator++(int)
666	{
667		tmat4x3<T, P> Result(*this);
668		++*this;
669		return Result;
670	}
671
672	template <typename T, precision P>
673	GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator--(int)
674	{
675		tmat4x3<T, P> Result(*this);
676		--*this;
677		return Result;
678	}
679
680	//////////////////////////////////////
681	// Boolean operators
682
683	template <typename T, precision P>
684	GLM_FUNC_QUALIFIER bool operator==
685	(
686		tmat4x3<T, P> const & m1,
687		tmat4x3<T, P> const & m2
688	)
689	{
690		return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
691	}
692
693	template <typename T, precision P>
694	GLM_FUNC_QUALIFIER bool operator!=
695	(
696		tmat4x3<T, P> const & m1,
697		tmat4x3<T, P> const & m2
698	)
699	{
700		return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
701	}
702} //namespace detail
703} //namespace glm
704
705