quaternion_trigonometric.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /// @ref ext_quaternion_trigonometric
  2. /// @file glm/ext/quaternion_trigonometric.hpp
  3. ///
  4. /// @defgroup ext_quaternion_trigonometric GLM_EXT_quaternion_trigonometric
  5. /// @ingroup ext
  6. ///
  7. /// Provides trigonometric functions for quaternion types
  8. ///
  9. /// Include <glm/ext/quaternion_trigonometric.hpp> to use the features of this extension.
  10. ///
  11. /// @see ext_quaternion_float
  12. /// @see ext_quaternion_double
  13. /// @see ext_quaternion_exponential
  14. /// @see ext_quaternion_geometric
  15. /// @see ext_quaternion_relational
  16. /// @see ext_quaternion_transform
  17. #pragma once
  18. // Dependency:
  19. #include "../trigonometric.hpp"
  20. #include "../exponential.hpp"
  21. #include "scalar_constants.hpp"
  22. #include "vector_relational.hpp"
  23. #include <limits>
  24. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  25. # pragma message("GLM: GLM_EXT_quaternion_trigonometric extension included")
  26. #endif
  27. namespace glm
  28. {
  29. /// @addtogroup ext_quaternion_trigonometric
  30. /// @{
  31. /// Returns the quaternion rotation angle.
  32. ///
  33. /// @param x A normalized quaternion.
  34. ///
  35. /// @tparam T A floating-point scalar type
  36. /// @tparam Q A value from qualifier enum
  37. template<typename T, qualifier Q>
  38. GLM_FUNC_DECL T angle(qua<T, Q> const& x);
  39. /// Returns the q rotation axis.
  40. ///
  41. /// @tparam T A floating-point scalar type
  42. /// @tparam Q A value from qualifier enum
  43. template<typename T, qualifier Q>
  44. GLM_FUNC_DECL vec<3, T, Q> axis(qua<T, Q> const& x);
  45. /// Build a quaternion from an angle and a normalized axis.
  46. ///
  47. /// @param angle Angle expressed in radians.
  48. /// @param axis Axis of the quaternion, must be normalized.
  49. ///
  50. /// @tparam T A floating-point scalar type
  51. /// @tparam Q A value from qualifier enum
  52. template<typename T, qualifier Q>
  53. GLM_FUNC_DECL qua<T, Q> angleAxis(T const& angle, vec<3, T, Q> const& axis);
  54. /// @}
  55. } //namespace glm
  56. #include "quaternion_trigonometric.inl"