matrix_integer.hpp 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. #pragma once
  20. // Dependencies
  21. #include "../gtc/constants.hpp"
  22. #include "../geometric.hpp"
  23. #include "../trigonometric.hpp"
  24. #include "../matrix.hpp"
  25. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  26. # pragma message("GLM: GLM_EXT_matrix_integer extension included")
  27. #endif
  28. namespace glm
  29. {
  30. /// @addtogroup ext_matrix_integer
  31. /// @{
  32. /// Multiply matrix x by matrix y component-wise, i.e.,
  33. /// result[i][j] is the scalar product of x[i][j] and y[i][j].
  34. ///
  35. /// @tparam C Integer between 1 and 4 included that qualify the number a column
  36. /// @tparam R Integer between 1 and 4 included that qualify the number a row
  37. /// @tparam T Floating-point or signed integer scalar types
  38. /// @tparam Q Value from qualifier enum
  39. ///
  40. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a>
  41. /// @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>
  42. template<length_t C, length_t R, typename T, qualifier Q>
  43. GLM_FUNC_DECL mat<C, R, T, Q> matrixCompMult(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y);
  44. /// Treats the first parameter c as a column vector
  45. /// and the second parameter r as a row vector
  46. /// and does a linear algebraic matrix multiply c * r.
  47. ///
  48. /// @tparam C Integer between 1 and 4 included that qualify the number a column
  49. /// @tparam R Integer between 1 and 4 included that qualify the number a row
  50. /// @tparam T Floating-point or signed integer scalar types
  51. /// @tparam Q Value from qualifier enum
  52. ///
  53. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct 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<length_t C, length_t R, typename T, qualifier Q>
  56. 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);
  57. /// Returns the transposed matrix of x
  58. ///
  59. /// @tparam C Integer between 1 and 4 included that qualify the number a column
  60. /// @tparam R Integer between 1 and 4 included that qualify the number a row
  61. /// @tparam T Floating-point or signed integer scalar types
  62. /// @tparam Q Value from qualifier enum
  63. ///
  64. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a>
  65. /// @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>
  66. template<length_t C, length_t R, typename T, qualifier Q>
  67. GLM_FUNC_DECL typename mat<C, R, T, Q>::transpose_type transpose(mat<C, R, T, Q> const& x);
  68. /// Return the determinant of a squared matrix.
  69. ///
  70. /// @tparam C Integer between 1 and 4 included that qualify the number a column
  71. /// @tparam R Integer between 1 and 4 included that qualify the number a row
  72. /// @tparam T Floating-point or signed integer scalar types
  73. /// @tparam Q Value from qualifier enum
  74. ///
  75. /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
  76. /// @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>
  77. template<length_t C, length_t R, typename T, qualifier Q>
  78. GLM_FUNC_DECL T determinant(mat<C, R, T, Q> const& m);
  79. /// @}
  80. }//namespace glm
  81. #include "matrix_integer.inl"