2 KB、70行 生 Blame 履歴
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_func_geometric
12/// @see ext_quaternion_float
13/// @see ext_quaternion_double
14
15#pragma once
16
17// Dependency:
18#include "../geometric.hpp"
19#include "../exponential.hpp"
20#include "../ext/vector_relational.hpp"
21
22#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
23# pragma message("GLM: GLM_EXT_quaternion_geometric extension included")
24#endif
25
26namespace glm
27{
28 /// @addtogroup ext_quaternion_geometric
29 /// @{
30
31 /// Returns the norm of a quaternions
32 ///
33 /// @tparam T Floating-point scalar types
34 /// @tparam Q Value from qualifier enum
35 ///
36 /// @see ext_quaternion_geometric
37 template<typename T, qualifier Q>
38 GLM_FUNC_DECL T length(qua<T, Q> const& q);
39
40 /// Returns the normalized quaternion.
41 ///
42 /// @tparam T Floating-point scalar types
43 /// @tparam Q Value from qualifier enum
44 ///
45 /// @see ext_quaternion_geometric
46 template<typename T, qualifier Q>
47 GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q> normalize(qua<T, Q> const& q);
48
49 /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
50 ///
51 /// @tparam T Floating-point scalar types.
52 /// @tparam Q Value from qualifier enum
53 ///
54 /// @see ext_quaternion_geometric
55 template<typename T, qualifier Q>
56 GLM_FUNC_DECL GLM_CONSTEXPR T dot(qua<T, Q> const& x, qua<T, Q> const& y);
57
58 /// Compute a cross product.
59 ///
60 /// @tparam T Floating-point scalar types
61 /// @tparam Q Value from qualifier enum
62 ///
63 /// @see ext_quaternion_geometric
64 template<typename T, qualifier Q>
65 GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> cross(qua<T, Q> const& q1, qua<T, Q> const& q2);
66
67 /// @}
68} //namespace glm
69
70#include "quaternion_geometric.inl"