1.8 KB、63行 生 Blame 履歴
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
18#pragma once
19
20// Dependency:
21#include "../trigonometric.hpp"
22#include "../exponential.hpp"
23#include "scalar_constants.hpp"
24#include "vector_relational.hpp"
25#include <limits>
26
27#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
28# pragma message("GLM: GLM_EXT_quaternion_trigonometric extension included")
29#endif
30
31namespace glm
32{
33 /// @addtogroup ext_quaternion_trigonometric
34 /// @{
35
36 /// Returns the quaternion rotation angle.
37 ///
38 /// @tparam T A floating-point scalar type
39 /// @tparam Q A value from qualifier enum
40 template<typename T, qualifier Q>
41 GLM_FUNC_DECL T angle(qua<T, Q> const& x);
42
43 /// Returns the q rotation axis.
44 ///
45 /// @tparam T A floating-point scalar type
46 /// @tparam Q A value from qualifier enum
47 template<typename T, qualifier Q>
48 GLM_FUNC_DECL vec<3, T, Q> axis(qua<T, Q> const& x);
49
50 /// Build a quaternion from an angle and a normalized axis.
51 ///
52 /// @param angle Angle expressed in radians.
53 /// @param axis Axis of the quaternion, must be normalized.
54 ///
55 /// @tparam T A floating-point scalar type
56 /// @tparam Q A value from qualifier enum
57 template<typename T, qualifier Q>
58 GLM_FUNC_DECL qua<T, Q> angleAxis(T const& angle, vec<3, T, Q> const& axis);
59
60 /// @}
61} //namespace glm
62
63#include "quaternion_trigonometric.inl"