9
3

quaternion_trigonometric.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. /// @tparam T A floating-point scalar type
  34. /// @tparam Q A value from qualifier enum
  35. template<typename T, qualifier Q>
  36. GLM_FUNC_DECL T angle(qua<T, Q> const& x);
  37. /// Returns the q rotation axis.
  38. ///
  39. /// @tparam T A floating-point scalar type
  40. /// @tparam Q A value from qualifier enum
  41. template<typename T, qualifier Q>
  42. GLM_FUNC_DECL vec<3, T, Q> axis(qua<T, Q> const& x);
  43. /// Build a quaternion from an angle and a normalized axis.
  44. ///
  45. /// @param angle Angle expressed in radians.
  46. /// @param axis Axis of the quaternion, must be normalized.
  47. ///
  48. /// @tparam T A floating-point scalar type
  49. /// @tparam Q A value from qualifier enum
  50. template<typename T, qualifier Q>
  51. GLM_FUNC_DECL qua<T, Q> angleAxis(T const& angle, vec<3, T, Q> const& axis);
  52. /// @}
  53. } //namespace glm
  54. #include "quaternion_trigonometric.inl"