matrix_interpolation.hpp 2.0 KB

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