| 1 | /// @ref ext_matrix_integer |
| 2 | /// @file glm/ext/matrix_integer.hpp |
| 3 | /// |
| 4 | /// @defgroup ext_matrix_integer GLM_EXT_matrix_integer |
| 5 | /// @ingroup ext |
| 6 | /// |
| 7 | /// Defines functions that generate common transformation matrices. |
| 8 | /// |
| 9 | /// The matrices generated by this extension use standard OpenGL fixed-function |
| 10 | /// conventions. For example, the lookAt function generates a transform from world |
| 11 | /// space into the specific eye space that the projective matrix functions |
| 12 | /// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility |
| 13 | /// specifications defines the particular layout of this eye space. |
| 14 | /// |
| 15 | /// Include <glm/ext/matrix_integer.hpp> to use the features of this extension. |
| 16 | /// |
| 17 | /// @see ext_matrix_projection |
| 18 | /// @see ext_matrix_clip_space |
| 19 | |
| 20 | #pragma once |
| 21 | |
| 22 | // Dependencies |
| 23 | #include "../gtc/constants.hpp" |
| 24 | #include "../geometric.hpp" |
| 25 | #include "../trigonometric.hpp" |
| 26 | #include "../matrix.hpp" |
| 27 | |
| 28 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) |
| 29 | # pragma message("GLM: GLM_EXT_matrix_integer extension included") |
| 30 | #endif |
| 31 | |
| 32 | namespace glm |
| 33 | { |
| 34 | /// @addtogroup ext_matrix_integer |
| 35 | /// @{ |
| 36 | |
| 37 | /// Multiply matrix x by matrix y component-wise, i.e., |
| 38 | /// result[i][j] is the scalar product of x[i][j] and y[i][j]. |
| 39 | /// |
| 40 | /// @tparam C Integer between 1 and 4 included that qualify the number a column |
| 41 | /// @tparam R Integer between 1 and 4 included that qualify the number a row |
| 42 | /// @tparam T Floating-point or signed integer scalar types |
| 43 | /// @tparam Q Value from qualifier enum |
| 44 | /// |
| 45 | /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a> |
| 46 | /// @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> |
| 47 | template<length_t C, length_t R, typename T, qualifier Q> |
| 48 | GLM_FUNC_DECL mat<C, R, T, Q> matrixCompMult(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y); |
| 49 | |
| 50 | /// Treats the first parameter c as a column vector |
| 51 | /// and the second parameter r as a row vector |
| 52 | /// and does a linear algebraic matrix multiply c * r. |
| 53 | /// |
| 54 | /// @tparam C Integer between 1 and 4 included that qualify the number a column |
| 55 | /// @tparam R Integer between 1 and 4 included that qualify the number a row |
| 56 | /// @tparam T Floating-point or signed integer scalar types |
| 57 | /// @tparam Q Value from qualifier enum |
| 58 | /// |
| 59 | /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a> |
| 60 | /// @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> |
| 61 | template<length_t C, length_t R, typename T, qualifier Q> |
| 62 | GLM_FUNC_DECL typename detail::outerProduct_trait<C, R, T, Q>::type outerProduct(vec<C, T, Q> const& c, vec<R, T, Q> const& r); |
| 63 | |
| 64 | /// Returns the transposed matrix of x |
| 65 | /// |
| 66 | /// @tparam C Integer between 1 and 4 included that qualify the number a column |
| 67 | /// @tparam R Integer between 1 and 4 included that qualify the number a row |
| 68 | /// @tparam T Floating-point or signed integer scalar types |
| 69 | /// @tparam Q Value from qualifier enum |
| 70 | /// |
| 71 | /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a> |
| 72 | /// @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> |
| 73 | template<length_t C, length_t R, typename T, qualifier Q> |
| 74 | GLM_FUNC_DECL typename mat<C, R, T, Q>::transpose_type transpose(mat<C, R, T, Q> const& x); |
| 75 | |
| 76 | /// Return the determinant of a squared matrix. |
| 77 | /// |
| 78 | /// @tparam C Integer between 1 and 4 included that qualify the number a column |
| 79 | /// @tparam R Integer between 1 and 4 included that qualify the number a row |
| 80 | /// @tparam T Floating-point or signed integer scalar types |
| 81 | /// @tparam Q Value from qualifier enum |
| 82 | /// |
| 83 | /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a> |
| 84 | /// @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> |
| 85 | template<length_t C, length_t R, typename T, qualifier Q> |
| 86 | GLM_FUNC_DECL T determinant(mat<C, R, T, Q> const& m); |
| 87 | |
| 88 | /// @} |
| 89 | }//namespace glm |
| 90 | |
| 91 | #include "matrix_integer.inl" |