quaternion_geometric.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /// @ref ext_quaternion_geometric
  2. /// @file glm/ext/quaternion_geometric.hpp
  3. ///
  4. /// @defgroup ext_quaternion_geometric GLM_EXT_quaternion_geometric
  5. /// @ingroup ext
  6. ///
  7. /// Provides geometric functions for quaternion types
  8. ///
  9. /// Include <glm/ext/quaternion_geometric.hpp> to use the features of this extension.
  10. ///
  11. /// @see core_geometric
  12. /// @see ext_quaternion_float
  13. /// @see ext_quaternion_double
  14. #pragma once
  15. // Dependency:
  16. #include "../geometric.hpp"
  17. #include "../exponential.hpp"
  18. #include "../ext/vector_relational.hpp"
  19. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  20. # pragma message("GLM: GLM_EXT_quaternion_geometric extension included")
  21. #endif
  22. namespace glm
  23. {
  24. /// @addtogroup ext_quaternion_geometric
  25. /// @{
  26. /// Returns the norm of a quaternions
  27. ///
  28. /// @tparam T Floating-point scalar types
  29. /// @tparam Q Value from qualifier enum
  30. ///
  31. /// @see ext_quaternion_geometric
  32. template<typename T, qualifier Q>
  33. GLM_FUNC_DECL T length(qua<T, Q> const& q);
  34. /// Returns the normalized quaternion.
  35. ///
  36. /// @tparam T Floating-point scalar types
  37. /// @tparam Q Value from qualifier enum
  38. ///
  39. /// @see ext_quaternion_geometric
  40. template<typename T, qualifier Q>
  41. GLM_FUNC_DECL qua<T, Q> normalize(qua<T, Q> const& q);
  42. /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
  43. ///
  44. /// @tparam T Floating-point scalar types.
  45. /// @tparam Q Value from qualifier enum
  46. ///
  47. /// @see ext_quaternion_geometric
  48. template<typename T, qualifier Q>
  49. GLM_FUNC_DECL T dot(qua<T, Q> const& x, qua<T, Q> const& y);
  50. /// Compute a cross product.
  51. ///
  52. /// @tparam T Floating-point scalar types
  53. /// @tparam Q Value from qualifier enum
  54. ///
  55. /// @see ext_quaternion_geometric
  56. template<typename T, qualifier Q>
  57. GLM_FUNC_QUALIFIER qua<T, Q> cross(qua<T, Q> const& q1, qua<T, Q> const& q2);
  58. /// @}
  59. } //namespace glm
  60. #include "quaternion_geometric.inl"