matrix_interpolation.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #ifndef GLM_ENABLE_EXPERIMENTAL
  17. # error "GLM: GLM_GTX_matrix_interpolation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
  18. #endif
  19. #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
  20. # pragma message("GLM: GLM_GTX_matrix_interpolation extension included")
  21. #endif
  22. namespace glm
  23. {
  24. /// @addtogroup gtx_matrix_interpolation
  25. /// @{
  26. /// Get the axis and angle of the rotation from a matrix.
  27. /// From GLM_GTX_matrix_interpolation extension.
  28. template <typename T, precision P>
  29. GLM_FUNC_DECL void axisAngle(
  30. tmat4x4<T, P> const & mat,
  31. vec<3, T, P> & axis,
  32. T & angle);
  33. /// Build a matrix from axis and angle.
  34. /// From GLM_GTX_matrix_interpolation extension.
  35. template <typename T, precision P>
  36. GLM_FUNC_DECL tmat4x4<T, P> axisAngleMatrix(
  37. vec<3, T, P> const & axis,
  38. T const angle);
  39. /// Extracts the rotation part of a matrix.
  40. /// From GLM_GTX_matrix_interpolation extension.
  41. template <typename T, precision P>
  42. GLM_FUNC_DECL tmat4x4<T, P> extractMatrixRotation(
  43. tmat4x4<T, P> const & mat);
  44. /// Build a interpolation of 4 * 4 matrixes.
  45. /// From GLM_GTX_matrix_interpolation extension.
  46. /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results.
  47. template <typename T, precision P>
  48. GLM_FUNC_DECL tmat4x4<T, P> interpolate(
  49. tmat4x4<T, P> const & m1,
  50. tmat4x4<T, P> const & m2,
  51. T const delta);
  52. /// @}
  53. }//namespace glm
  54. #include "matrix_interpolation.inl"