1.9 KB、65行 生 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 /// @param x A normalized quaternion.
39 ///
40 /// @tparam T A floating-point scalar type
41 /// @tparam Q A value from qualifier enum
42 template<typename T, qualifier Q>
43 GLM_FUNC_DECL T angle(qua<T, Q> const& x);
44
45 /// Returns the q rotation axis.
46 ///
47 /// @tparam T A floating-point scalar type
48 /// @tparam Q A value from qualifier enum
49 template<typename T, qualifier Q>
50 GLM_FUNC_DECL vec<3, T, Q> axis(qua<T, Q> const& x);
51
52 /// Build a quaternion from an angle and a normalized axis.
53 ///
54 /// @param angle Angle expressed in radians.
55 /// @param axis Axis of the quaternion, must be normalized.
56 ///
57 /// @tparam T A floating-point scalar type
58 /// @tparam Q A value from qualifier enum
59 template<typename T, qualifier Q>
60 GLM_FUNC_DECL qua<T, Q> angleAxis(T const& angle, vec<3, T, Q> const& axis);
61
62 /// @}
63} //namespace glm
64
65#include "quaternion_trigonometric.inl"