matrix_interpolation.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /// @ref gtx_matrix_interpolation
  2. /// @file glm/gtx/matrix_interpolation.hpp
  3. /// @author Ghenadii Ursachi (the.asteroth@gmail.com)
  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. #elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  19. # pragma message("GLM: GLM_GTX_matrix_interpolation extension included")
  20. #endif
  21. namespace glm
  22. {
  23. /// @addtogroup gtx_matrix_interpolation
  24. /// @{
  25. /// Get the axis and angle of the rotation from a matrix.
  26. /// From GLM_GTX_matrix_interpolation extension.
  27. template<typename T, qualifier Q>
  28. GLM_FUNC_DISCARD_DECL void axisAngle(
  29. mat<4, 4, T, Q> const& Mat, vec<3, T, Q> & Axis, T & Angle);
  30. /// Build a matrix from axis and angle.
  31. /// From GLM_GTX_matrix_interpolation extension.
  32. template<typename T, qualifier Q>
  33. GLM_FUNC_DECL mat<4, 4, T, Q> axisAngleMatrix(
  34. vec<3, T, Q> const& Axis, T const Angle);
  35. /// Extracts the rotation part of a matrix.
  36. /// From GLM_GTX_matrix_interpolation extension.
  37. template<typename T, qualifier Q>
  38. GLM_FUNC_DECL mat<4, 4, T, Q> extractMatrixRotation(
  39. mat<4, 4, T, Q> const& Mat);
  40. /// Build a interpolation of 4 * 4 matrixes.
  41. /// From GLM_GTX_matrix_interpolation extension.
  42. /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results.
  43. template<typename T, qualifier Q>
  44. GLM_FUNC_DECL mat<4, 4, T, Q> interpolate(
  45. mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2, T const Delta);
  46. /// @}
  47. }//namespace glm
  48. #include "matrix_interpolation.inl"