1
///////////////////////////////////////////////////////////////////////////////////
2
/// OpenGL Mathematics (glm.g-truc.net)
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:
12
/// The above copyright notice and this permission notice shall be included in
13
/// all copies or substantial portions of the Software.
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
24
/// @file glm/core/type_mat4x2.hpp
25
/// @date 2006-10-01 / 2011-06-15
26
/// @author Christophe Riccio
27
///////////////////////////////////////////////////////////////////////////////////
29
#ifndef glm_core_type_mat4x2
30
#define glm_core_type_mat4x2
32
#include "type_mat.hpp"
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;
51
// \brief Template for 4 columns and 2 rows matrix of floating-point numbers.
52
// \ingroup core_template
58
typedef std::size_t size_type;
59
typedef tvec2<T> col_type;
60
typedef tvec4<T> row_type;
61
GLM_FUNC_DECL size_type length() const;
62
static GLM_FUNC_DECL size_type col_size();
63
static GLM_FUNC_DECL size_type row_size();
65
typedef tmat4x2<T> type;
66
typedef tmat2x4<T> transpose_type;
74
GLM_FUNC_DECL tmat4x2();
75
GLM_FUNC_DECL tmat4x2(tmat4x2 const & m);
77
GLM_FUNC_DECL explicit tmat4x2(
79
GLM_FUNC_DECL explicit tmat4x2(
80
value_type const & x);
81
GLM_FUNC_DECL explicit tmat4x2(
82
value_type const & x0, value_type const & y0,
83
value_type const & x1, value_type const & y1,
84
value_type const & x2, value_type const & y2,
85
value_type const & x3, value_type const & y3);
86
GLM_FUNC_DECL explicit tmat4x2(
92
//////////////////////////////////////
95
GLM_FUNC_DECL explicit tmat4x2(
100
typename X1, typename Y1,
101
typename X2, typename Y2,
102
typename X3, typename Y3,
103
typename X4, typename Y4
105
GLM_FUNC_DECL explicit tmat4x2(
106
X1 const & x1, Y1 const & y1,
107
X2 const & x2, Y2 const & y2,
108
X3 const & x3, Y3 const & y3,
109
X4 const & x4, Y4 const & y4);
111
template <typename V1, typename V2, typename V3, typename V4>
112
GLM_FUNC_DECL explicit tmat4x2(
113
tvec2<V1> const & v1,
114
tvec2<V2> const & v2,
115
tvec2<V3> const & v3,
116
tvec2<V4> const & v4);
118
// Matrix conversions
119
template <typename U>
120
GLM_FUNC_DECL explicit tmat4x2(tmat4x2<U> const & m);
122
GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T> const & x);
123
GLM_FUNC_DECL explicit tmat4x2(tmat3x3<T> const & x);
124
GLM_FUNC_DECL explicit tmat4x2(tmat4x4<T> const & x);
125
GLM_FUNC_DECL explicit tmat4x2(tmat2x3<T> const & x);
126
GLM_FUNC_DECL explicit tmat4x2(tmat3x2<T> const & x);
127
GLM_FUNC_DECL explicit tmat4x2(tmat2x4<T> const & x);
128
GLM_FUNC_DECL explicit tmat4x2(tmat4x3<T> const & x);
129
GLM_FUNC_DECL explicit tmat4x2(tmat3x4<T> const & x);
132
GLM_FUNC_DECL col_type & operator[](size_type i);
133
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
135
// Unary updatable operators
136
GLM_FUNC_DECL tmat4x2<T>& operator= (tmat4x2<T> const & m);
137
template <typename U>
138
GLM_FUNC_DECL tmat4x2<T>& operator= (tmat4x2<U> const & m);
139
template <typename U>
140
GLM_FUNC_DECL tmat4x2<T>& operator+= (U const & s);
141
template <typename U>
142
GLM_FUNC_DECL tmat4x2<T>& operator+= (tmat4x2<U> const & m);
143
template <typename U>
144
GLM_FUNC_DECL tmat4x2<T>& operator-= (U const & s);
145
template <typename U>
146
GLM_FUNC_DECL tmat4x2<T>& operator-= (tmat4x2<U> const & m);
147
template <typename U>
148
GLM_FUNC_DECL tmat4x2<T>& operator*= (U const & s);
149
template <typename U>
150
GLM_FUNC_DECL tmat4x2<T>& operator*= (tmat4x2<U> const & m);
151
template <typename U>
152
GLM_FUNC_DECL tmat4x2<T>& operator/= (U const & s);
154
GLM_FUNC_DECL tmat4x2<T>& operator++ ();
155
GLM_FUNC_DECL tmat4x2<T>& operator-- ();
159
template <typename T>
160
tmat4x2<T> operator+ (
161
tmat4x2<T> const & m,
162
typename tmat4x2<T>::value_type const & s);
164
template <typename T>
165
tmat4x2<T> operator+ (
166
tmat4x2<T> const & m1,
167
tmat4x2<T> const & m2);
169
template <typename T>
170
tmat4x2<T> operator- (
171
tmat4x2<T> const & m,
172
typename tmat4x2<T>::value_type const & s);
174
template <typename T>
175
tmat4x2<T> operator- (
176
tmat4x2<T> const & m1,
177
tmat4x2<T> const & m2);
179
template <typename T>
180
tmat4x2<T> operator* (
181
tmat4x2<T> const & m,
182
typename tmat4x2<T>::value_type const & s);
184
template <typename T>
185
tmat4x2<T> operator* (
186
typename tmat4x2<T>::value_type const & s,
187
tmat4x2<T> const & m);
189
template <typename T>
190
typename tmat4x2<T>::col_type operator* (
191
tmat4x2<T> const & m,
192
typename tmat4x2<T>::row_type const & v);
194
template <typename T>
195
typename tmat4x2<T>::row_type operator* (
196
typename tmat4x2<T>::col_type const & v,
197
tmat4x2<T> const & m);
199
template <typename T>
200
tmat3x2<T> operator* (
201
tmat4x2<T> const & m1,
202
tmat3x4<T> const & m2);
204
template <typename T>
205
tmat4x2<T> operator* (
206
tmat4x2<T> const & m1,
207
tmat4x4<T> const & m2);
209
template <typename T>
210
tmat2x3<T> operator* (
211
tmat4x3<T> const & m1,
212
tmat2x4<T> const & m2);
214
template <typename T>
215
tmat4x2<T> operator/ (
216
tmat4x2<T> const & m,
217
typename tmat4x2<T>::value_type const & s);
219
template <typename T>
220
tmat4x2<T> operator/ (
221
typename tmat4x2<T>::value_type const & s,
222
tmat4x2<T> const & m);
224
// Unary constant operators
225
template <typename T>
226
tmat4x2<T> const operator- (
227
tmat4x2<T> const & m);
229
template <typename T>
230
tmat4x2<T> const operator-- (
231
tmat4x2<T> const & m,
234
template <typename T>
235
tmat4x2<T> const operator++ (
236
tmat4x2<T> const & m,
241
/// @addtogroup core_precision
244
/// 4 columns of 2 components matrix of low precision floating-point numbers.
245
/// There is no guarantee on the actual precision.
247
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
248
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
249
typedef detail::tmat4x2<lowp_float> lowp_mat4x2;
251
/// 4 columns of 2 components matrix of medium precision floating-point numbers.
252
/// There is no guarantee on the actual precision.
254
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
255
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
256
typedef detail::tmat4x2<mediump_float> mediump_mat4x2;
258
/// 4 columns of 2 components matrix of high precision floating-point numbers.
259
/// There is no guarantee on the actual precision.
261
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
262
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
263
typedef detail::tmat4x2<highp_float> highp_mat4x2;
268
#ifndef GLM_EXTERNAL_TEMPLATE
269
#include "type_mat4x2.inl"
272
#endif //glm_core_type_mat4x2