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

« back to all changes in this revision

Viewing changes to 3rd_party/glm/glm/core/func_matrix.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/func_matrix.hpp
25
 
/// @date 2008-08-03 / 2011-06-15
26
 
/// @author Christophe Riccio
27
 
///
28
 
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
29
 
/// 
30
 
/// @defgroup core_func_matrix Matrix functions
31
 
/// @ingroup core
32
 
/// 
33
 
/// For each of the following built-in matrix functions, there is both a 
34
 
/// single-precision floating point version, where all arguments and return values 
35
 
/// are single precision, and a double-precision floating version, where all 
36
 
/// arguments and return values are double precision. Only the single-precision 
37
 
/// floating point version is shown.
38
 
///////////////////////////////////////////////////////////////////////////////////
39
 
 
40
 
#ifndef GLM_CORE_func_matrix
41
 
#define GLM_CORE_func_matrix GLM_VERSION
42
 
 
43
 
namespace glm
44
 
{
45
 
        /// @addtogroup core_func_matrix
46
 
        /// @{
47
 
 
48
 
        /// Multiply matrix x by matrix y component-wise, i.e., 
49
 
        /// result[i][j] is the scalar product of x[i][j] and y[i][j].
50
 
        /// 
51
 
        /// @tparam matType Floating-point matrix types.
52
 
    ///
53
 
    /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a>
54
 
    /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
55
 
        template <typename matType> 
56
 
        matType matrixCompMult(
57
 
                matType const & x, 
58
 
                matType const & y);
59
 
 
60
 
        /// Treats the first parameter c as a column vector 
61
 
        /// and the second parameter r as a row vector
62
 
        /// and does a linear algebraic matrix multiply c * r.
63
 
        /// 
64
 
        /// @tparam matType Floating-point matrix types.
65
 
    ///
66
 
    /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a>
67
 
    /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
68
 
        /// 
69
 
        /// @todo Clarify the declaration to specify that matType doesn't have to be provided when used.
70
 
    template <typename vecType, typename matType> 
71
 
        matType outerProduct(
72
 
                vecType const & c, 
73
 
                vecType const & r);
74
 
 
75
 
        /// Returns the transposed matrix of x
76
 
        /// 
77
 
        /// @tparam matType Floating-point matrix types.
78
 
    ///
79
 
    /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a>
80
 
    /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>    
81
 
    template <typename matType> 
82
 
        typename matType::transpose_type transpose(
83
 
                matType const & x);
84
 
        
85
 
        /// Return the determinant of a mat2 matrix. 
86
 
        /// 
87
 
        /// @tparam valType Floating-point scalar types.
88
 
    ///
89
 
    /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
90
 
    /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>    
91
 
        template <typename valType> 
92
 
        typename detail::tmat2x2<valType>::value_type determinant(
93
 
                detail::tmat2x2<valType> const & m);
94
 
 
95
 
        /// Return the determinant of a mat3 matrix. 
96
 
        /// 
97
 
        /// @tparam valType Floating-point scalar types.
98
 
    ///
99
 
    /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
100
 
    /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>    
101
 
        template <typename valType> 
102
 
        typename detail::tmat3x3<valType>::value_type determinant(
103
 
                detail::tmat3x3<valType> const & m);
104
 
 
105
 
        /// Return the determinant of a mat4 matrix. 
106
 
        /// 
107
 
        /// @tparam valType Floating-point scalar types.
108
 
    ///
109
 
    /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
110
 
    /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>            
111
 
    template <typename valType> 
112
 
        typename detail::tmat4x4<valType>::value_type determinant(
113
 
                detail::tmat4x4<valType> const & m);
114
 
 
115
 
        /// Return the inverse of a mat2 matrix. 
116
 
        /// 
117
 
        /// @tparam valType Floating-point scalar types.
118
 
    ///
119
 
    /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
120
 
    /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>     
121
 
        template <typename valType> 
122
 
        detail::tmat2x2<valType> inverse(
123
 
                detail::tmat2x2<valType> const & m);
124
 
 
125
 
        /// Return the inverse of a mat3 matrix. 
126
 
        /// 
127
 
        /// @tparam valType Floating-point scalar types.
128
 
    ///
129
 
    /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
130
 
    /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> 
131
 
        template <typename valType> 
132
 
        detail::tmat3x3<valType> inverse(
133
 
                detail::tmat3x3<valType> const & m);
134
 
 
135
 
        /// Return the inverse of a mat4 matrix. 
136
 
        /// 
137
 
        /// @tparam valType Floating-point scalar types.
138
 
    ///
139
 
    /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
140
 
    /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
141
 
        template <typename valType> 
142
 
        detail::tmat4x4<valType> inverse(
143
 
                detail::tmat4x4<valType> const & m);
144
 
 
145
 
        /// @}
146
 
}//namespace glm
147
 
 
148
 
#include "func_matrix.inl"
149
 
 
150
 
#endif//GLM_CORE_func_matrix