~mir-team/mir/in-process-egl+input-conglomeration

« back to all changes in this revision

Viewing changes to 3rd_party/glm/glm/core/type_mat4x2.inl

Merged trunk and fixed issues

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
///////////////////////////////////////////////////////////////////////////////////
2
 
/// OpenGL Mathematics (glm.g-truc.net)
3
 
///
4
 
/// Copyright (c) 2005 - 2012 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_mat4x2.inl
25
 
/// @date 2006-10-01 / 2011-06-15
26
 
/// @author Christophe Riccio
27
 
///////////////////////////////////////////////////////////////////////////////////
28
 
 
29
 
namespace glm{
30
 
namespace detail
31
 
{
32
 
    template <typename T>
33
 
    GLM_FUNC_QUALIFIER typename tmat4x2<T>::size_type tmat4x2<T>::length() const
34
 
    {
35
 
        return 4;
36
 
    }
37
 
 
38
 
        template <typename T>
39
 
        GLM_FUNC_QUALIFIER typename tmat4x2<T>::size_type tmat4x2<T>::col_size()
40
 
        {
41
 
                return 2;
42
 
        }
43
 
 
44
 
        template <typename T>
45
 
        GLM_FUNC_QUALIFIER typename tmat4x2<T>::size_type tmat4x2<T>::row_size()
46
 
        {
47
 
                return 4;
48
 
        }
49
 
 
50
 
        //////////////////////////////////////
51
 
        // Accesses
52
 
 
53
 
        template <typename T>
54
 
        GLM_FUNC_QUALIFIER typename tmat4x2<T>::col_type & 
55
 
        tmat4x2<T>::operator[]
56
 
        (
57
 
                size_type i
58
 
        )
59
 
        {
60
 
                assert(i < this->length());
61
 
                return this->value[i];
62
 
        }
63
 
 
64
 
        template <typename T>
65
 
        GLM_FUNC_QUALIFIER typename tmat4x2<T>::col_type const & 
66
 
        tmat4x2<T>::operator[]
67
 
        (
68
 
                size_type i
69
 
        ) const
70
 
        {
71
 
                assert(i < this->length());
72
 
                return this->value[i];
73
 
        }
74
 
 
75
 
    //////////////////////////////////////////////////////////////
76
 
    // Constructors
77
 
 
78
 
    template <typename T> 
79
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2()
80
 
    {
81
 
                value_type const Zero(0);
82
 
                value_type const One(1);
83
 
        this->value[0] = col_type(One, Zero);
84
 
        this->value[1] = col_type(Zero, One);
85
 
        this->value[2] = col_type(Zero, Zero);
86
 
        this->value[3] = col_type(Zero, Zero);
87
 
    }
88
 
 
89
 
    template <typename T> 
90
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
91
 
        (
92
 
                tmat4x2<T> const & m
93
 
        )
94
 
    {
95
 
        this->value[0] = m.value[0];
96
 
        this->value[1] = m.value[1];
97
 
        this->value[2] = m.value[2];
98
 
        this->value[3] = m.value[3];
99
 
    }
100
 
 
101
 
    template <typename T> 
102
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
103
 
        (
104
 
                ctor
105
 
        )
106
 
    {}
107
 
 
108
 
    template <typename T> 
109
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
110
 
        (
111
 
                value_type const & s
112
 
        )
113
 
    {
114
 
                value_type const Zero(0);
115
 
        this->value[0] = col_type(s, Zero);
116
 
        this->value[1] = col_type(Zero, s);
117
 
        this->value[2] = col_type(Zero, Zero);
118
 
        this->value[3] = col_type(Zero, Zero);
119
 
    }
120
 
 
121
 
    template <typename T> 
122
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
123
 
    (
124
 
        value_type const & x0, value_type const & y0,
125
 
        value_type const & x1, value_type const & y1,
126
 
        value_type const & x2, value_type const & y2,
127
 
        value_type const & x3, value_type const & y3
128
 
    )
129
 
    {
130
 
        this->value[0] = col_type(x0, y0);
131
 
        this->value[1] = col_type(x1, y1);
132
 
        this->value[2] = col_type(x2, y2);
133
 
        this->value[3] = col_type(x3, y3);
134
 
    }
135
 
 
136
 
    template <typename T> 
137
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
138
 
    (
139
 
        col_type const & v0, 
140
 
        col_type const & v1, 
141
 
        col_type const & v2,
142
 
        col_type const & v3
143
 
    )
144
 
    {
145
 
        this->value[0] = v0;
146
 
        this->value[1] = v1;
147
 
        this->value[2] = v2;
148
 
        this->value[3] = v3;
149
 
    }
150
 
 
151
 
        //////////////////////////////////////
152
 
        // Convertion constructors
153
 
        template <typename T> 
154
 
        template <typename U> 
155
 
        GLM_FUNC_DECL tmat4x2<T>::tmat4x2
156
 
        (
157
 
                U const & s
158
 
        )
159
 
        {
160
 
                value_type const Zero(0);
161
 
        this->value[0] = tvec2<T>(value_type(s), Zero);
162
 
        this->value[1] = tvec2<T>(Zero, value_type(s));
163
 
        this->value[2] = tvec2<T>(Zero, Zero);
164
 
        this->value[3] = tvec2<T>(Zero, Zero);
165
 
        }
166
 
        
167
 
        template <typename T> 
168
 
        template <
169
 
                typename X1, typename Y1, 
170
 
                typename X2, typename Y2, 
171
 
                typename X3, typename Y3, 
172
 
                typename X4, typename Y4>  
173
 
        GLM_FUNC_DECL tmat4x2<T>::tmat4x2
174
 
        (
175
 
                X1 const & x1, Y1 const & y1, 
176
 
                X2 const & x2, Y2 const & y2,
177
 
                X3 const & x3, Y3 const & y3,
178
 
                X4 const & x4, Y4 const & y4
179
 
        )               
180
 
        {
181
 
        this->value[0] = col_type(value_type(x1), value_type(y1));
182
 
        this->value[1] = col_type(value_type(x2), value_type(y2));
183
 
        this->value[2] = col_type(value_type(x3), value_type(y3));
184
 
                this->value[3] = col_type(value_type(x4), value_type(y4));
185
 
        }
186
 
        
187
 
        template <typename T> 
188
 
        template <typename V1, typename V2, typename V3, typename V4> 
189
 
        GLM_FUNC_DECL tmat4x2<T>::tmat4x2
190
 
        (
191
 
                tvec2<V1> const & v1, 
192
 
                tvec2<V2> const & v2, 
193
 
                tvec2<V3> const & v3,
194
 
                tvec2<V4> const & v4
195
 
        )               
196
 
        {
197
 
        this->value[0] = col_type(v1);
198
 
        this->value[1] = col_type(v2);
199
 
        this->value[2] = col_type(v3);
200
 
                this->value[3] = col_type(v4);
201
 
        }
202
 
 
203
 
    // Conversion
204
 
    template <typename T> 
205
 
    template <typename U> 
206
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
207
 
        (
208
 
                tmat4x2<U> const & m
209
 
        )
210
 
    {
211
 
        this->value[0] = col_type(m[0]);
212
 
        this->value[1] = col_type(m[1]);
213
 
        this->value[2] = col_type(m[2]);
214
 
        this->value[3] = col_type(m[3]);
215
 
        }
216
 
 
217
 
    template <typename T> 
218
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
219
 
        (
220
 
                tmat2x2<T> const & m
221
 
        )
222
 
    {
223
 
        this->value[0] = col_type(m[0]);
224
 
        this->value[1] = col_type(m[1]);
225
 
        this->value[2] = col_type(value_type(0));
226
 
        this->value[3] = col_type(value_type(0));
227
 
    }
228
 
 
229
 
    template <typename T> 
230
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
231
 
        (
232
 
                tmat3x3<T> const & m
233
 
        )
234
 
    {
235
 
        this->value[0] = col_type(m[0]);
236
 
        this->value[1] = col_type(m[1]);
237
 
        this->value[2] = col_type(m[2]);
238
 
        this->value[3] = col_type(value_type(0));
239
 
    }
240
 
 
241
 
    template <typename T> 
242
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
243
 
        (
244
 
                tmat4x4<T> const & m
245
 
        )
246
 
    {
247
 
        this->value[0] = col_type(m[0]);
248
 
        this->value[1] = col_type(m[1]);
249
 
        this->value[2] = col_type(m[2]);
250
 
        this->value[3] = col_type(m[3]);
251
 
    }
252
 
 
253
 
    template <typename T> 
254
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
255
 
        (
256
 
                tmat2x3<T> const & m
257
 
        )
258
 
    {
259
 
        this->value[0] = col_type(m[0]);
260
 
        this->value[1] = col_type(m[1]);
261
 
        this->value[2] = col_type(value_type(0));
262
 
        this->value[3] = col_type(value_type(0));
263
 
    }
264
 
 
265
 
    template <typename T> 
266
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
267
 
        (
268
 
                tmat3x2<T> const & m
269
 
        )
270
 
    {
271
 
        this->value[0] = col_type(m[0]);
272
 
        this->value[1] = col_type(m[1]);
273
 
        this->value[2] = col_type(m[2]);
274
 
        this->value[3] = col_type(value_type(0));
275
 
    }
276
 
 
277
 
    template <typename T> 
278
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
279
 
        (
280
 
                tmat2x4<T> const & m
281
 
        )
282
 
    {
283
 
        this->value[0] = col_type(m[0]);
284
 
        this->value[1] = col_type(m[1]);
285
 
        this->value[2] = col_type(value_type(0));
286
 
        this->value[3] = col_type(value_type(0));
287
 
    }
288
 
 
289
 
    template <typename T> 
290
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
291
 
        (
292
 
                tmat4x3<T> const & m
293
 
        )
294
 
    {
295
 
        this->value[0] = col_type(m[0]);
296
 
        this->value[1] = col_type(m[1]);
297
 
        this->value[2] = col_type(m[2]);
298
 
        this->value[3] = col_type(m[3]);
299
 
    }
300
 
 
301
 
    template <typename T> 
302
 
    GLM_FUNC_QUALIFIER tmat4x2<T>::tmat4x2
303
 
        (
304
 
                tmat3x4<T> const & m
305
 
        )
306
 
    {
307
 
        this->value[0] = col_type(m[0]);
308
 
        this->value[1] = col_type(m[1]);
309
 
        this->value[2] = col_type(m[2]);
310
 
        this->value[3] = col_type(value_type(0));
311
 
    }
312
 
 
313
 
    //////////////////////////////////////////////////////////////
314
 
    // Unary updatable operators
315
 
 
316
 
    template <typename T> 
317
 
    GLM_FUNC_QUALIFIER tmat4x2<T>& tmat4x2<T>::operator= 
318
 
        (
319
 
                tmat4x2<T> const & m
320
 
        )
321
 
    {
322
 
        this->value[0] = m[0];
323
 
        this->value[1] = m[1];
324
 
        this->value[2] = m[2];
325
 
        this->value[3] = m[3];
326
 
        return *this;
327
 
    }
328
 
 
329
 
    template <typename T> 
330
 
        template <typename U> 
331
 
    GLM_FUNC_QUALIFIER tmat4x2<T>& tmat4x2<T>::operator= 
332
 
        (
333
 
                tmat4x2<U> const & m
334
 
        )
335
 
    {
336
 
        this->value[0] = m[0];
337
 
        this->value[1] = m[1];
338
 
        this->value[2] = m[2];
339
 
        this->value[3] = m[3];
340
 
        return *this;
341
 
    }
342
 
 
343
 
    template <typename T> 
344
 
        template <typename U> 
345
 
    GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator+= 
346
 
        (
347
 
                U const & s
348
 
        )
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> 
358
 
        template <typename U> 
359
 
    GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator+= 
360
 
        (
361
 
                tmat4x2<U> const & m
362
 
        )
363
 
    {
364
 
        this->value[0] += m[0];
365
 
        this->value[1] += m[1];
366
 
        this->value[2] += m[2];
367
 
        this->value[3] += m[3];
368
 
        return *this;
369
 
    }
370
 
 
371
 
    template <typename T> 
372
 
        template <typename U> 
373
 
    GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator-= 
374
 
        (
375
 
                U const & s
376
 
        )
377
 
    {
378
 
        this->value[0] -= s;
379
 
        this->value[1] -= s;
380
 
        this->value[2] -= s;
381
 
        this->value[3] -= s;
382
 
        return *this;
383
 
    }
384
 
 
385
 
    template <typename T> 
386
 
        template <typename U> 
387
 
    GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator-= 
388
 
        (
389
 
                tmat4x2<U> const & m
390
 
        )
391
 
    {
392
 
        this->value[0] -= m[0];
393
 
        this->value[1] -= m[1];
394
 
        this->value[2] -= m[2];
395
 
        this->value[3] -= m[3];
396
 
        return *this;
397
 
    }
398
 
 
399
 
    template <typename T> 
400
 
        template <typename U> 
401
 
    GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator*= 
402
 
        (
403
 
                U const & s
404
 
        )
405
 
    {
406
 
        this->value[0] *= s;
407
 
        this->value[1] *= s;
408
 
        this->value[2] *= s;
409
 
        this->value[3] *= s;
410
 
        return *this;
411
 
    }
412
 
 
413
 
    template <typename T> 
414
 
        template <typename U> 
415
 
    GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator*= 
416
 
        (
417
 
                tmat4x2<U> const & m
418
 
        )
419
 
    {
420
 
        return (*this = tmat4x2<T>(*this * m));
421
 
    }
422
 
 
423
 
    template <typename T>
424
 
        template <typename U> 
425
 
    GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator/= 
426
 
        (
427
 
                U const & s
428
 
        )
429
 
    {
430
 
        this->value[0] /= s;
431
 
        this->value[1] /= s;
432
 
        this->value[2] /= s;
433
 
        this->value[3] /= s;
434
 
        return *this;
435
 
    }
436
 
 
437
 
    template <typename T> 
438
 
    GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator++ ()
439
 
    {
440
 
        ++this->value[0];
441
 
        ++this->value[1];
442
 
        ++this->value[2];
443
 
        ++this->value[3];
444
 
        return *this;
445
 
    }
446
 
 
447
 
    template <typename T> 
448
 
    GLM_FUNC_QUALIFIER tmat4x2<T> & tmat4x2<T>::operator-- ()
449
 
    {
450
 
        --this->value[0];
451
 
        --this->value[1];
452
 
        --this->value[2];
453
 
        --this->value[3];
454
 
        return *this;
455
 
    }
456
 
 
457
 
    //////////////////////////////////////////////////////////////
458
 
    // Binary operators
459
 
 
460
 
    template <typename T> 
461
 
    GLM_FUNC_QUALIFIER tmat4x2<T> operator+ 
462
 
        (
463
 
                tmat4x2<T> const & m, 
464
 
                typename tmat4x2<T>::value_type const & s
465
 
        )
466
 
    {
467
 
        return tmat4x2<T>(
468
 
            m[0] + s,
469
 
            m[1] + s,
470
 
            m[2] + s,
471
 
            m[3] + s);
472
 
    }
473
 
 
474
 
    template <typename T> 
475
 
    GLM_FUNC_QUALIFIER tmat4x2<T> operator+ 
476
 
        (       
477
 
                tmat4x2<T> const & m1, 
478
 
                tmat4x2<T> const & m2
479
 
        )
480
 
    {
481
 
        return tmat4x2<T>(
482
 
            m1[0] + m2[0],
483
 
            m1[1] + m2[1],
484
 
            m1[2] + m2[2],
485
 
            m1[3] + m2[3]);
486
 
    }
487
 
 
488
 
    template <typename T> 
489
 
    GLM_FUNC_QUALIFIER tmat4x2<T> operator- 
490
 
        (
491
 
                tmat4x2<T> const & m, 
492
 
                typename tmat4x2<T>::value_type const & s
493
 
        )
494
 
    {
495
 
        return tmat4x2<T>(
496
 
            m[0] - s,
497
 
            m[1] - s,
498
 
            m[2] - s,
499
 
            m[3] - s);
500
 
    }
501
 
 
502
 
    template <typename T> 
503
 
    GLM_FUNC_QUALIFIER tmat4x2<T> operator- 
504
 
        (       
505
 
                tmat4x2<T> const & m1, 
506
 
                tmat4x2<T> const & m2
507
 
        )
508
 
    {
509
 
        return tmat4x2<T>(
510
 
            m1[0] - m2[0],
511
 
            m1[1] - m2[1],
512
 
            m1[2] - m2[2],
513
 
            m1[3] - m2[3]);
514
 
    }
515
 
 
516
 
    template <typename T> 
517
 
    GLM_FUNC_QUALIFIER tmat4x2<T> operator* 
518
 
        (
519
 
                tmat4x2<T> const & m, 
520
 
                typename tmat4x2<T>::value_type const & s
521
 
        )
522
 
    {
523
 
        return tmat4x2<T>(
524
 
            m[0] * s,
525
 
            m[1] * s,
526
 
            m[2] * s,
527
 
            m[3] * s);
528
 
    }
529
 
 
530
 
    template <typename T> 
531
 
    GLM_FUNC_QUALIFIER tmat4x2<T> operator* 
532
 
        (
533
 
                typename tmat4x2<T>::value_type const & s, 
534
 
                tmat4x2<T> const & m
535
 
        )
536
 
    {
537
 
        return tmat4x2<T>(
538
 
            m[0] * s,
539
 
            m[1] * s,
540
 
            m[2] * s,
541
 
            m[3] * s);
542
 
    }
543
 
 
544
 
    template <typename T>
545
 
    GLM_FUNC_QUALIFIER typename tmat4x2<T>::col_type operator* 
546
 
        (
547
 
                tmat4x2<T> const & m, 
548
 
                typename tmat4x2<T>::row_type const & v)
549
 
    {
550
 
        return typename tmat4x2<T>::col_type(
551
 
            m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
552
 
            m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w);
553
 
    }
554
 
 
555
 
    template <typename T> 
556
 
    GLM_FUNC_QUALIFIER typename tmat4x2<T>::row_type operator* 
557
 
        (
558
 
                typename tmat4x2<T>::col_type const & v, 
559
 
                tmat4x2<T> const & m) 
560
 
    {
561
 
        return typename tmat4x2<T>::row_type(
562
 
            v.x * m[0][0] + v.y * m[0][1],
563
 
            v.x * m[1][0] + v.y * m[1][1],
564
 
            v.x * m[2][0] + v.y * m[2][1],
565
 
            v.x * m[3][0] + v.y * m[3][1]);
566
 
    }
567
 
 
568
 
    template <typename T> 
569
 
    GLM_FUNC_QUALIFIER tmat2x2<T> operator* 
570
 
        (
571
 
                tmat4x2<T> const & m1, 
572
 
                tmat2x4<T> const & m2
573
 
        )
574
 
    {
575
 
        T const SrcA00 = m1[0][0];
576
 
        T const SrcA01 = m1[0][1];
577
 
        T const SrcA10 = m1[1][0];
578
 
        T const SrcA11 = m1[1][1];
579
 
        T const SrcA20 = m1[2][0];
580
 
        T const SrcA21 = m1[2][1];
581
 
        T const SrcA30 = m1[3][0];
582
 
        T const SrcA31 = m1[3][1];
583
 
 
584
 
        T const SrcB00 = m2[0][0];
585
 
        T const SrcB01 = m2[0][1];
586
 
        T const SrcB02 = m2[0][2];
587
 
        T const SrcB03 = m2[0][3];
588
 
        T const SrcB10 = m2[1][0];
589
 
        T const SrcB11 = m2[1][1];
590
 
        T const SrcB12 = m2[1][2];
591
 
        T const SrcB13 = m2[1][3];
592
 
 
593
 
        tmat2x2<T> Result(tmat2x2<T>::null);
594
 
        Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;
595
 
        Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;
596
 
        Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;
597
 
        Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13;
598
 
        return Result;
599
 
    }
600
 
 
601
 
        template <typename T>
602
 
        GLM_FUNC_QUALIFIER tmat3x2<T> operator* 
603
 
        (
604
 
                tmat4x2<T> const & m1, 
605
 
                tmat3x4<T> const & m2
606
 
        )
607
 
        {
608
 
                return tmat3x2<T>(
609
 
                        m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
610
 
                        m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
611
 
                        m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
612
 
                        m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
613
 
                        m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3],
614
 
                        m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3]);
615
 
        }
616
 
 
617
 
        template <typename T>
618
 
        GLM_FUNC_QUALIFIER tmat4x2<T> operator* 
619
 
        (
620
 
                tmat4x2<T> const & m1, 
621
 
                tmat4x4<T> const & m2
622
 
        )
623
 
        {
624
 
                return tmat4x2<T>(
625
 
                        m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
626
 
                        m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
627
 
                        m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
628
 
                        m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3],
629
 
                        m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3],
630
 
                        m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3],
631
 
                        m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3],
632
 
                        m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]);
633
 
        }
634
 
 
635
 
    template <typename T> 
636
 
    GLM_FUNC_QUALIFIER tmat4x2<T> operator/ 
637
 
        (
638
 
                tmat4x2<T> const & m, 
639
 
                typename tmat4x2<T>::value_type const & s
640
 
        )
641
 
    {
642
 
        return tmat4x2<T>(
643
 
            m[0] / s,
644
 
            m[1] / s,
645
 
            m[2] / s,
646
 
            m[3] / s);        
647
 
    }
648
 
 
649
 
    template <typename T> 
650
 
    GLM_FUNC_QUALIFIER tmat4x2<T> operator/ 
651
 
        (
652
 
                typename tmat4x2<T>::value_type const & s, 
653
 
                tmat4x2<T> const & m
654
 
        )
655
 
    {
656
 
        return tmat4x2<T>(
657
 
            s / m[0],
658
 
            s / m[1],
659
 
            s / m[2],
660
 
            s / m[3]);        
661
 
    }
662
 
 
663
 
        // Unary constant operators
664
 
    template <typename T> 
665
 
    GLM_FUNC_QUALIFIER tmat4x2<T> const operator- 
666
 
        (
667
 
                tmat4x2<T> const & m
668
 
        )
669
 
    {
670
 
        return tmat4x2<T>(
671
 
            -m[0], 
672
 
            -m[1], 
673
 
            -m[2], 
674
 
            -m[3]);
675
 
    }
676
 
 
677
 
    template <typename T> 
678
 
    GLM_FUNC_QUALIFIER tmat4x2<T> const operator++ 
679
 
        (
680
 
                tmat4x2<T> const & m, 
681
 
                int
682
 
        ) 
683
 
    {
684
 
        return tmat4x2<T>(
685
 
                        m[0] + typename tmat4x2<T>::value_type(1),
686
 
            m[1] + typename tmat4x2<T>::value_type(1),
687
 
            m[2] + typename tmat4x2<T>::value_type(1),
688
 
            m[3] + typename tmat4x2<T>::value_type(1));
689
 
    }
690
 
 
691
 
    template <typename T> 
692
 
    GLM_FUNC_QUALIFIER tmat4x2<T> const operator-- 
693
 
        (
694
 
                tmat4x2<T> const & m, 
695
 
                int
696
 
        ) 
697
 
    {
698
 
        return tmat4x2<T>(
699
 
            m[0] - typename tmat4x2<T>::value_type(1),
700
 
            m[1] - typename tmat4x2<T>::value_type(1),
701
 
            m[2] - typename tmat4x2<T>::value_type(1),
702
 
            m[3] - typename tmat4x2<T>::value_type(1));
703
 
    }
704
 
 
705
 
        //////////////////////////////////////
706
 
        // Boolean operators
707
 
 
708
 
        template <typename T> 
709
 
        GLM_FUNC_QUALIFIER bool operator==
710
 
        (
711
 
                tmat4x2<T> const & m1, 
712
 
                tmat4x2<T> const & m2
713
 
        )
714
 
        {
715
 
                return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
716
 
        }
717
 
 
718
 
        template <typename T> 
719
 
        GLM_FUNC_QUALIFIER bool operator!=
720
 
        (
721
 
                tmat4x2<T> const & m1, 
722
 
                tmat4x2<T> const & m2
723
 
        )
724
 
        {
725
 
                return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
726
 
        }
727
 
 
728
 
} //namespace detail
729
 
} //namespace glm