matrix_interpolation.hpp 2.0 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. /// Include <glm/gtx/matrix_interpolation.hpp> to use the features of this extension.
  11. ///
  12. /// Allows to directly interpolate two matrices.
  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_ENABLE && !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, qualifier Q>
  29. GLM_FUNC_DECL void axisAngle(
  30. mat<4, 4, T, Q> const& Mat, vec<3, T, Q> & Axis, T & Angle);
  31. /// Build a matrix from axis and angle.
  32. /// From GLM_GTX_matrix_interpolation extension.
  33. template<typename T, qualifier Q>
  34. GLM_FUNC_DECL mat<4, 4, T, Q> axisAngleMatrix(
  35. vec<3, T, Q> const& Axis, T const Angle);
  36. /// Extracts the rotation part of a matrix.
  37. /// From GLM_GTX_matrix_interpolation extension.
  38. template<typename T, qualifier Q>
  39. GLM_FUNC_DECL mat<4, 4, T, Q> extractMatrixRotation(
  40. mat<4, 4, T, Q> 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, qualifier Q>
  45. GLM_FUNC_DECL mat<4, 4, T, Q> interpolate(
  46. mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2, T const Delta);
  47. /// @}
  48. }//namespace glm
  49. #include "matrix_interpolation.inl"