~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.hpp

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.hpp
25
 
/// @date 2006-10-01 / 2011-06-15
26
 
/// @author Christophe Riccio
27
 
///////////////////////////////////////////////////////////////////////////////////
28
 
 
29
 
#ifndef glm_core_type_mat4x2
30
 
#define glm_core_type_mat4x2
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
 
        // \brief Template for 4 columns and 2 rows matrix of floating-point numbers.
52
 
        // \ingroup core_template
53
 
        template <typename T> 
54
 
        struct tmat4x2
55
 
        {
56
 
                enum ctor{null};
57
 
                typedef T value_type;
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();
64
 
 
65
 
                typedef tmat4x2<T> type;
66
 
                typedef tmat2x4<T> transpose_type;
67
 
 
68
 
        private:
69
 
                // Data 
70
 
                col_type value[4];
71
 
 
72
 
        public:
73
 
                // Constructors
74
 
                GLM_FUNC_DECL tmat4x2();
75
 
                GLM_FUNC_DECL tmat4x2(tmat4x2 const & m);
76
 
 
77
 
                GLM_FUNC_DECL explicit tmat4x2(
78
 
                        ctor Null);
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(
87
 
                        col_type const & v0, 
88
 
                        col_type const & v1,
89
 
                        col_type const & v2,
90
 
                        col_type const & v3);
91
 
            
92
 
                //////////////////////////////////////
93
 
                // Conversions
94
 
                template <typename U> 
95
 
                GLM_FUNC_DECL explicit tmat4x2(
96
 
            U const & x);
97
 
                        
98
 
                template 
99
 
        <
100
 
            typename X1, typename Y1, 
101
 
            typename X2, typename Y2, 
102
 
            typename X3, typename Y3,
103
 
            typename X4, typename Y4
104
 
        > 
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);
110
 
                        
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);
117
 
            
118
 
                // Matrix conversions
119
 
                template <typename U> 
120
 
                GLM_FUNC_DECL explicit tmat4x2(tmat4x2<U> const & m);
121
 
                        
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);
130
 
 
131
 
                // Accesses
132
 
                GLM_FUNC_DECL col_type & operator[](size_type i);
133
 
                GLM_FUNC_DECL col_type const & operator[](size_type i) const;
134
 
 
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);
153
 
 
154
 
                GLM_FUNC_DECL tmat4x2<T>& operator++ ();
155
 
                GLM_FUNC_DECL tmat4x2<T>& operator-- ();
156
 
        };
157
 
 
158
 
        // Binary operators
159
 
        template <typename T> 
160
 
        tmat4x2<T> operator+ (
161
 
                tmat4x2<T> const & m, 
162
 
                typename tmat4x2<T>::value_type const & s);
163
 
            
164
 
        template <typename T> 
165
 
        tmat4x2<T> operator+ (
166
 
                tmat4x2<T> const & m1, 
167
 
                tmat4x2<T> const & m2);
168
 
            
169
 
        template <typename T> 
170
 
        tmat4x2<T> operator- (
171
 
                tmat4x2<T> const & m, 
172
 
                typename tmat4x2<T>::value_type const & s);
173
 
 
174
 
        template <typename T> 
175
 
        tmat4x2<T> operator- (
176
 
                tmat4x2<T> const & m1, 
177
 
                tmat4x2<T> const & m2);
178
 
 
179
 
        template <typename T> 
180
 
        tmat4x2<T> operator* (
181
 
                tmat4x2<T> const & m, 
182
 
                typename tmat4x2<T>::value_type const & s);
183
 
 
184
 
        template <typename T> 
185
 
        tmat4x2<T> operator* (
186
 
                typename tmat4x2<T>::value_type const & s, 
187
 
                tmat4x2<T> const & m);
188
 
 
189
 
        template <typename T>
190
 
        typename tmat4x2<T>::col_type operator* (
191
 
                tmat4x2<T> const & m, 
192
 
                typename tmat4x2<T>::row_type const & v);
193
 
 
194
 
        template <typename T> 
195
 
        typename tmat4x2<T>::row_type operator* (
196
 
                typename tmat4x2<T>::col_type const & v, 
197
 
                tmat4x2<T> const & m);
198
 
 
199
 
        template <typename T>
200
 
        tmat3x2<T> operator* (
201
 
                tmat4x2<T> const & m1, 
202
 
                tmat3x4<T> const & m2);
203
 
                
204
 
        template <typename T>
205
 
        tmat4x2<T> operator* (
206
 
                tmat4x2<T> const & m1, 
207
 
                tmat4x4<T> const & m2);
208
 
                
209
 
        template <typename T>
210
 
        tmat2x3<T> operator* (
211
 
                tmat4x3<T> const & m1, 
212
 
                tmat2x4<T> const & m2);
213
 
 
214
 
        template <typename T> 
215
 
        tmat4x2<T> operator/ (
216
 
                tmat4x2<T> const & m, 
217
 
                typename tmat4x2<T>::value_type const & s);
218
 
 
219
 
        template <typename T> 
220
 
        tmat4x2<T> operator/ (
221
 
                typename tmat4x2<T>::value_type const & s, 
222
 
                tmat4x2<T> const & m);
223
 
 
224
 
        // Unary constant operators
225
 
        template <typename T> 
226
 
        tmat4x2<T> const operator-  (
227
 
                tmat4x2<T> const & m);
228
 
 
229
 
        template <typename T> 
230
 
        tmat4x2<T> const operator-- (
231
 
                tmat4x2<T> const & m, 
232
 
                int);
233
 
 
234
 
        template <typename T> 
235
 
        tmat4x2<T> const operator++ (
236
 
                tmat4x2<T> const & m, 
237
 
                int);
238
 
 
239
 
} //namespace detail
240
 
 
241
 
        /// @addtogroup core_precision
242
 
        /// @{
243
 
 
244
 
        /// 4 columns of 2 components matrix of low precision floating-point numbers.
245
 
        /// There is no guarantee on the actual precision.
246
 
        /// 
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;
250
 
 
251
 
        /// 4 columns of 2 components matrix of medium precision floating-point numbers.
252
 
        /// There is no guarantee on the actual precision.
253
 
        /// 
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;
257
 
 
258
 
        /// 4 columns of 2 components matrix of high precision floating-point numbers.
259
 
        /// There is no guarantee on the actual precision.
260
 
        /// 
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;
264
 
 
265
 
        /// @}
266
 
}//namespace glm
267
 
 
268
 
#ifndef GLM_EXTERNAL_TEMPLATE
269
 
#include "type_mat4x2.inl"
270
 
#endif
271
 
 
272
 
#endif //glm_core_type_mat4x2