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

« back to all changes in this revision

Viewing changes to 3rd_party/glm/glm/core/type_mat2x3.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_mat2x3.hpp
25
 
/// @date 2006-10-01 / 2011-06-15
26
 
/// @author Christophe Riccio
27
 
///////////////////////////////////////////////////////////////////////////////////
28
 
 
29
 
#ifndef glm_core_type_mat2x3
30
 
#define glm_core_type_mat2x3
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 2 columns and 3 rows matrix of floating-point numbers.
52
 
        // \ingroup core_template
53
 
        template <typename T> 
54
 
        struct tmat2x3
55
 
        {
56
 
                enum ctor{null};
57
 
                typedef T value_type;
58
 
                typedef std::size_t size_type;
59
 
                typedef tvec3<T> col_type;
60
 
                typedef tvec2<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 tmat2x3<T> type;
66
 
                typedef tmat3x2<T> transpose_type;
67
 
 
68
 
        private:
69
 
                // Data 
70
 
                col_type value[2];
71
 
 
72
 
        public:
73
 
                // Constructors
74
 
                GLM_FUNC_DECL tmat2x3();
75
 
                GLM_FUNC_DECL tmat2x3(tmat2x3 const & m);
76
 
 
77
 
                GLM_FUNC_DECL explicit tmat2x3(
78
 
                        ctor);
79
 
                GLM_FUNC_DECL explicit tmat2x3(
80
 
                        value_type const & s);
81
 
                GLM_FUNC_DECL explicit tmat2x3(
82
 
                        value_type const & x0, value_type const & y0, value_type const & z0,
83
 
                        value_type const & x1, value_type const & y1, value_type const & z1);
84
 
                GLM_FUNC_DECL explicit tmat2x3(
85
 
                        col_type const & v0, 
86
 
                        col_type const & v1);
87
 
            
88
 
                //////////////////////////////////////
89
 
                // Conversions
90
 
                template <typename U> 
91
 
                GLM_FUNC_DECL explicit tmat2x3(
92
 
            U const & x);
93
 
                        
94
 
                template <typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2> 
95
 
                GLM_FUNC_DECL explicit tmat2x3(
96
 
            X1 const & x1, Y1 const & y1, Z1 const & z1, 
97
 
            X2 const & x2, Y2 const & y2, Z2 const & z2);
98
 
                        
99
 
                template <typename U, typename V> 
100
 
                GLM_FUNC_DECL explicit tmat2x3(
101
 
            tvec3<U> const & v1, 
102
 
            tvec3<V> const & v2);
103
 
            
104
 
                //////////////////////////////////////
105
 
        // Matrix conversion
106
 
                template <typename U> 
107
 
                GLM_FUNC_DECL explicit tmat2x3(tmat2x3<U> const & m);
108
 
 
109
 
                GLM_FUNC_DECL explicit tmat2x3(tmat2x2<T> const & x);
110
 
                GLM_FUNC_DECL explicit tmat2x3(tmat3x3<T> const & x);
111
 
                GLM_FUNC_DECL explicit tmat2x3(tmat4x4<T> const & x);
112
 
                GLM_FUNC_DECL explicit tmat2x3(tmat2x4<T> const & x);
113
 
                GLM_FUNC_DECL explicit tmat2x3(tmat3x2<T> const & x);
114
 
                GLM_FUNC_DECL explicit tmat2x3(tmat3x4<T> const & x);
115
 
                GLM_FUNC_DECL explicit tmat2x3(tmat4x2<T> const & x);
116
 
                GLM_FUNC_DECL explicit tmat2x3(tmat4x3<T> const & x);
117
 
 
118
 
                // Accesses
119
 
                col_type & operator[](size_type i);
120
 
                col_type const & operator[](size_type i) const;
121
 
 
122
 
                // Unary updatable operators
123
 
                GLM_FUNC_DECL tmat2x3<T> & operator=  (tmat2x3<T> const & m);
124
 
                template <typename U> 
125
 
                GLM_FUNC_DECL tmat2x3<T> & operator=  (tmat2x3<U> const & m);
126
 
                template <typename U> 
127
 
                GLM_FUNC_DECL tmat2x3<T> & operator+= (U const & s);
128
 
                template <typename U> 
129
 
                GLM_FUNC_DECL tmat2x3<T> & operator+= (tmat2x3<U> const & m);
130
 
                template <typename U> 
131
 
                GLM_FUNC_DECL tmat2x3<T> & operator-= (U const & s);
132
 
                template <typename U> 
133
 
                GLM_FUNC_DECL tmat2x3<T> & operator-= (tmat2x3<U> const & m);
134
 
                template <typename U> 
135
 
                GLM_FUNC_DECL tmat2x3<T> & operator*= (U const & s);
136
 
                template <typename U> 
137
 
                GLM_FUNC_DECL tmat2x3<T> & operator*= (tmat2x3<U> const & m);
138
 
                template <typename U> 
139
 
                GLM_FUNC_DECL tmat2x3<T> & operator/= (U const & s);
140
 
 
141
 
                GLM_FUNC_DECL tmat2x3<T> & operator++ ();
142
 
                GLM_FUNC_DECL tmat2x3<T> & operator-- ();
143
 
        };
144
 
 
145
 
        // Binary operators
146
 
        template <typename T> 
147
 
        tmat2x3<T> operator+ (
148
 
                tmat2x3<T> const & m, 
149
 
                typename tmat2x3<T>::value_type const & s);
150
 
            
151
 
        template <typename T> 
152
 
        tmat2x3<T> operator+ (
153
 
                tmat2x3<T> const & m1, 
154
 
                tmat2x3<T> const & m2);
155
 
            
156
 
        template <typename T> 
157
 
        tmat2x3<T> operator- (
158
 
                tmat2x3<T> const & m, 
159
 
                typename tmat2x3<T>::value_type const & s);
160
 
 
161
 
        template <typename T> 
162
 
        tmat2x3<T> operator- (
163
 
                tmat2x3<T> const & m1, 
164
 
                tmat2x3<T> const & m2);
165
 
 
166
 
        template <typename T> 
167
 
        tmat2x3<T> operator* (
168
 
                tmat2x3<T> const & m, 
169
 
                typename tmat2x3<T>::value_type const & s);
170
 
 
171
 
        template <typename T> 
172
 
        tmat2x3<T> operator* (
173
 
                typename tmat2x3<T>::value_type const & s, 
174
 
                tmat2x3<T> const & m);
175
 
 
176
 
        template <typename T>
177
 
        typename tmat2x3<T>::col_type operator* (
178
 
                tmat2x3<T> const & m, 
179
 
                typename tmat2x3<T>::row_type const & v);
180
 
 
181
 
        template <typename T> 
182
 
        typename tmat2x3<T>::row_type operator* (
183
 
                typename tmat2x3<T>::col_type const & v, 
184
 
                tmat2x3<T> const & m);
185
 
 
186
 
        template <typename T>
187
 
        tmat2x3<T> operator* (
188
 
                tmat2x3<T> const & m1, 
189
 
                tmat2x2<T> const & m2);
190
 
 
191
 
        template <typename T>
192
 
        tmat3x3<T> operator* (
193
 
                tmat2x3<T> const & m1, 
194
 
                tmat3x2<T> const & m2);
195
 
                
196
 
        template <typename T>
197
 
        tmat4x3<T> operator* (
198
 
                tmat2x3<T> const & m1, 
199
 
                tmat4x2<T> const & m2);
200
 
 
201
 
        template <typename T> 
202
 
        tmat2x3<T> operator/ (
203
 
                tmat2x3<T> const & m, 
204
 
                typename tmat2x3<T>::value_type const & s);
205
 
 
206
 
        template <typename T> 
207
 
        tmat2x3<T> operator/ (
208
 
                typename tmat2x3<T>::value_type const & s,
209
 
                tmat2x3<T> const & m);
210
 
 
211
 
        // Unary constant operators
212
 
        template <typename T> 
213
 
        tmat2x3<T> const operator-  (
214
 
                tmat2x3<T> const & m);
215
 
 
216
 
        template <typename T> 
217
 
        tmat2x3<T> const operator-- (
218
 
                tmat2x3<T> const & m, 
219
 
                int);
220
 
 
221
 
        template <typename T> 
222
 
        tmat2x3<T> const operator++ (
223
 
                tmat2x3<T> const & m, 
224
 
                int);
225
 
 
226
 
} //namespace detail
227
 
 
228
 
        /// @addtogroup core_precision
229
 
        /// @{
230
 
 
231
 
        /// 2 columns of 3 components matrix of low precision floating-point numbers.
232
 
        /// There is no guarantee on the actual precision.
233
 
        /// 
234
 
        /// @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>
235
 
        /// @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>
236
 
        typedef detail::tmat2x3<lowp_float>             lowp_mat2x3;
237
 
    
238
 
        /// 2 columns of 3 components matrix of medium precision floating-point numbers. 
239
 
        /// There is no guarantee on the actual precision.
240
 
        /// 
241
 
        /// @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>
242
 
        /// @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>
243
 
        typedef detail::tmat2x3<mediump_float>  mediump_mat2x3;
244
 
    
245
 
        /// 2 columns of 3 components matrix of high precision floating-point numbers.
246
 
        /// There is no guarantee on the actual precision.
247
 
        /// 
248
 
        /// @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>
249
 
        /// @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>
250
 
        typedef detail::tmat2x3<highp_float>    highp_mat2x3;
251
 
 
252
 
        /// @}
253
 
}//namespace glm
254
 
 
255
 
#ifndef GLM_EXTERNAL_TEMPLATE
256
 
#include "type_mat2x3.inl"
257
 
#endif
258
 
 
259
 
#endif //glm_core_type_mat2x3