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/func_matrix.hpp
25
/// @date 2008-08-03 / 2011-06-15
26
/// @author Christophe Riccio
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>
30
/// @defgroup core_func_matrix Matrix functions
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
///////////////////////////////////////////////////////////////////////////////////
40
#ifndef GLM_CORE_func_matrix
41
#define GLM_CORE_func_matrix GLM_VERSION
45
/// @addtogroup core_func_matrix
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].
51
/// @tparam matType Floating-point matrix types.
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(
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.
64
/// @tparam matType Floating-point matrix types.
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>
69
/// @todo Clarify the declaration to specify that matType doesn't have to be provided when used.
70
template <typename vecType, typename matType>
75
/// Returns the transposed matrix of x
77
/// @tparam matType Floating-point matrix types.
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(
85
/// Return the determinant of a mat2 matrix.
87
/// @tparam valType Floating-point scalar types.
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);
95
/// Return the determinant of a mat3 matrix.
97
/// @tparam valType Floating-point scalar types.
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);
105
/// Return the determinant of a mat4 matrix.
107
/// @tparam valType Floating-point scalar types.
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);
115
/// Return the inverse of a mat2 matrix.
117
/// @tparam valType Floating-point scalar types.
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);
125
/// Return the inverse of a mat3 matrix.
127
/// @tparam valType Floating-point scalar types.
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);
135
/// Return the inverse of a mat4 matrix.
137
/// @tparam valType Floating-point scalar types.
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);
148
#include "func_matrix.inl"
150
#endif//GLM_CORE_func_matrix