matrix_interpolation.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /// @ref gtx_matrix_interpolation
  2. /// @file glm/gtx/matrix_interpolation.hpp
  3. /// @author Ghenadii Ursachi ([email protected])
  4. ///
  5. /// @see core (dependence)
  6. ///
  7. /// @defgroup gtx_matrix_interpolation GLM_GTX_matrix_interpolation
  8. /// @ingroup gtx
  9. ///
  10. /// @brief Allows to directly interpolate two exiciting matrices.
  11. ///
  12. /// <glm/gtx/matrix_interpolation.hpp> need to be included to use these functionalities.
  13. #pragma once
  14. // Dependency:
  15. #include "../glm.hpp"
  16. #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
  17. # pragma message("GLM: GLM_GTX_matrix_interpolation extension included")
  18. #endif
  19. namespace glm
  20. {
  21. /// @addtogroup gtx_matrix_interpolation
  22. /// @{
  23. /// Get the axis and angle of the rotation from a matrix.
  24. /// From GLM_GTX_matrix_interpolation extension.
  25. template <typename T, precision P>
  26. GLM_FUNC_DECL void axisAngle(
  27. tmat4x4<T, P> const & mat,
  28. tvec3<T, P> & axis,
  29. T & angle);
  30. /// Build a matrix from axis and angle.
  31. /// From GLM_GTX_matrix_interpolation extension.
  32. template <typename T, precision P>
  33. GLM_FUNC_DECL tmat4x4<T, P> axisAngleMatrix(
  34. tvec3<T, P> const & axis,
  35. T const angle);
  36. /// Extracts the rotation part of a matrix.
  37. /// From GLM_GTX_matrix_interpolation extension.
  38. template <typename T, precision P>
  39. GLM_FUNC_DECL tmat4x4<T, P> extractMatrixRotation(
  40. tmat4x4<T, P> const & mat);
  41. /// Build a interpolation of 4 * 4 matrixes.
  42. /// From GLM_GTX_matrix_interpolation extension.
  43. /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results.
  44. template <typename T, precision P>
  45. GLM_FUNC_DECL tmat4x4<T, P> interpolate(
  46. tmat4x4<T, P> const & m1,
  47. tmat4x4<T, P> const & m2,
  48. T const delta);
  49. /// @}
  50. }//namespace glm
  51. #include "matrix_interpolation.inl"