func_matrix.hpp 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2008-08-03
  5. // Updated : 2010-02-04
  6. // Licence : This source is under MIT License
  7. // File : glm/core/func_matrix.hpp
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. #ifndef glm_core_func_matrix
  10. #define glm_core_func_matrix
  11. namespace glm
  12. {
  13. namespace test{
  14. void main_core_func_matrix();
  15. }//namespace test
  16. namespace core{
  17. namespace function{
  18. //! Define all matrix functions from Section 8.5 of GLSL 1.30.8 specification. Included in glm namespace.
  19. namespace matrix{
  20. /// \addtogroup core_funcs
  21. ///@{
  22. //! Multiply matrix x by matrix y component-wise, i.e.,
  23. //! result[i][j] is the scalar product of x[i][j] and y[i][j].
  24. //! (From GLSL 1.30.08 specification, section 8.5)
  25. template <typename matType>
  26. matType matrixCompMult(
  27. matType const & x,
  28. matType const & y);
  29. //! Treats the first parameter c as a column vector
  30. //! and the second parameter r as a row vector
  31. //! and does a linear algebraic matrix multiply c * r.
  32. //! (From GLSL 1.30.08 specification, section 8.5)
  33. template <typename vecType, typename matType>
  34. matType outerProduct(
  35. vecType const & c,
  36. vecType const & r);
  37. //! Returns the transposed matrix of x
  38. //! (From GLSL 1.30.08 specification, section 8.5)
  39. template <typename matType>
  40. typename matType::transpose_type transpose(
  41. matType const & x);
  42. //! Return the determinant of a mat2 matrix.
  43. //! (From GLSL 1.50.09 specification, section 8.5)..
  44. template <typename T>
  45. typename detail::tmat2x2<T>::value_type determinant(
  46. detail::tmat2x2<T> const & m);
  47. //! Return the determinant of a mat3 matrix.
  48. //! (From GLSL 1.50.09 specification, section 8.5).
  49. template <typename T>
  50. typename detail::tmat3x3<T>::value_type determinant(
  51. detail::tmat3x3<T> const & m);
  52. //! Return the determinant of a mat4 matrix.
  53. //! (From GLSL 1.50.09 specification, section 8.5).
  54. template <typename T>
  55. typename detail::tmat4x4<T>::value_type determinant(
  56. detail::tmat4x4<T> const & m);
  57. //! Return the inverse of a mat2 matrix.
  58. //! (From GLSL 1.40.07 specification, section 8.5).
  59. template <typename T>
  60. detail::tmat2x2<T> inverse(
  61. detail::tmat2x2<T> const & m);
  62. //! Return the inverse of a mat3 matrix.
  63. //! (From GLSL 1.40.07 specification, section 8.5).
  64. template <typename T>
  65. detail::tmat3x3<T> inverse(
  66. detail::tmat3x3<T> const & m);
  67. //! Return the inverse of a mat4 matrix.
  68. //! (From GLSL 1.40.07 specification, section 8.5).
  69. template <typename T>
  70. detail::tmat4x4<T> inverse(
  71. detail::tmat4x4<T> const & m);
  72. ///@}
  73. }//namespace matrix
  74. }//namespace function
  75. }//namespace core
  76. using namespace core::function::matrix;
  77. }//namespace glm
  78. #include "func_matrix.inl"
  79. #endif//glm_core_func_matrix