7 #include "../detail/type_mat3x3.hpp"
8 #include "../detail/type_mat4x4.hpp"
9 #include "../detail/type_vec3.hpp"
10 #include "../detail/type_vec4.hpp"
11 #include "../ext/vector_relational.hpp"
12 #include "../ext/quaternion_relational.hpp"
13 #include "../gtc/constants.hpp"
14 #include "../gtc/matrix_transform.hpp"
18 template<
typename T, qualifier Q>
23 typedef qua<T, Q> type;
28 # if GLM_SILENT_WARNINGS == GLM_ENABLE
29 # if GLM_COMPILER & GLM_COMPILER_GCC
30 # pragma GCC diagnostic push
31 # pragma GCC diagnostic ignored "-Wpedantic"
32 # elif GLM_COMPILER & GLM_COMPILER_CLANG
33 # pragma clang diagnostic push
34 # pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
35 # pragma clang diagnostic ignored "-Wnested-anon-types"
36 # elif GLM_COMPILER & GLM_COMPILER_VC
37 # pragma warning(push)
38 # pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
42 # if GLM_LANG & GLM_LANG_CXXMS_FLAG
45 struct { T x, y, z, w;};
47 typename detail::storage<4, T, detail::is_aligned<Q>::value>::type data;
53 # if GLM_SILENT_WARNINGS == GLM_ENABLE
54 # if GLM_COMPILER & GLM_COMPILER_CLANG
55 # pragma clang diagnostic pop
56 # elif GLM_COMPILER & GLM_COMPILER_GCC
57 # pragma GCC diagnostic pop
58 # elif GLM_COMPILER & GLM_COMPILER_VC
65 typedef length_t length_type;
68 GLM_FUNC_DECL
static GLM_CONSTEXPR length_type
length(){
return 4;}
70 GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i);
71 GLM_FUNC_DECL GLM_CONSTEXPR T
const& operator[](length_type i)
const;
75 GLM_FUNC_DECL GLM_CONSTEXPR qua() GLM_DEFAULT;
76 GLM_FUNC_DECL GLM_CONSTEXPR qua(qua<T, Q> const& q) GLM_DEFAULT;
78 GLM_FUNC_DECL GLM_CONSTEXPR qua(qua<T, P> const& q);
82 GLM_FUNC_DECL GLM_CONSTEXPR qua(T s, vec<3, T, Q> const& v);
83 GLM_FUNC_DECL GLM_CONSTEXPR qua(T w, T x, T y, T z);
87 template<typename U, qualifier P>
88 GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT qua(qua<U, P> const& q);
91 # if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
92 GLM_FUNC_DECL
explicit operator mat<3, 3, T, Q>()
const;
93 GLM_FUNC_DECL
explicit operator mat<4, 4, T, Q>()
const;
102 GLM_FUNC_DECL qua(vec<3, T, Q>
const& u, vec<3, T, Q>
const& v);
105 GLM_FUNC_DECL GLM_EXPLICIT qua(vec<3, T, Q>
const&
eulerAngles);
106 GLM_FUNC_DECL GLM_EXPLICIT qua(mat<3, 3, T, Q>
const& q);
107 GLM_FUNC_DECL GLM_EXPLICIT qua(mat<4, 4, T, Q>
const& q);
111 GLM_FUNC_DECL qua<T, Q>& operator=(qua<T, Q>
const& q) GLM_DEFAULT;
114 GLM_FUNC_DECL qua<T, Q>& operator=(qua<U, Q>
const& q);
116 GLM_FUNC_DECL qua<T, Q>& operator+=(qua<U, Q>
const& q);
118 GLM_FUNC_DECL qua<T, Q>& operator-=(qua<U, Q>
const& q);
120 GLM_FUNC_DECL qua<T, Q>& operator*=(qua<U, Q>
const& q);
122 GLM_FUNC_DECL qua<T, Q>& operator*=(U s);
124 GLM_FUNC_DECL qua<T, Q>& operator/=(U s);
129 template<
typename T, qualifier Q>
130 GLM_FUNC_DECL qua<T, Q> operator+(qua<T, Q>
const& q);
132 template<
typename T, qualifier Q>
133 GLM_FUNC_DECL qua<T, Q> operator-(qua<T, Q>
const& q);
137 template<
typename T, qualifier Q>
138 GLM_FUNC_DECL qua<T, Q> operator+(qua<T, Q>
const& q, qua<T, Q>
const& p);
140 template<
typename T, qualifier Q>
141 GLM_FUNC_DECL qua<T, Q> operator-(qua<T, Q>
const& q, qua<T, Q>
const& p);
143 template<
typename T, qualifier Q>
144 GLM_FUNC_DECL qua<T, Q> operator*(qua<T, Q>
const& q, qua<T, Q>
const& p);
146 template<
typename T, qualifier Q>
147 GLM_FUNC_DECL vec<3, T, Q> operator*(qua<T, Q>
const& q, vec<3, T, Q>
const& v);
149 template<
typename T, qualifier Q>
150 GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q>
const& v, qua<T, Q>
const& q);
152 template<
typename T, qualifier Q>
153 GLM_FUNC_DECL vec<4, T, Q> operator*(qua<T, Q>
const& q, vec<4, T, Q>
const& v);
155 template<
typename T, qualifier Q>
156 GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q>
const& v, qua<T, Q>
const& q);
158 template<
typename T, qualifier Q>
159 GLM_FUNC_DECL qua<T, Q> operator*(qua<T, Q>
const& q, T
const& s);
161 template<
typename T, qualifier Q>
162 GLM_FUNC_DECL qua<T, Q> operator*(T
const& s, qua<T, Q>
const& q);
164 template<
typename T, qualifier Q>
165 GLM_FUNC_DECL qua<T, Q> operator/(qua<T, Q>
const& q, T
const& s);
169 template<
typename T, qualifier Q>
170 GLM_FUNC_DECL GLM_CONSTEXPR
bool operator==(qua<T, Q>
const& q1, qua<T, Q>
const& q2);
172 template<
typename T, qualifier Q>
173 GLM_FUNC_DECL GLM_CONSTEXPR
bool operator!=(qua<T, Q>
const& q1, qua<T, Q>
const& q2);
176 #ifndef GLM_EXTERNAL_TEMPLATE
177 #include "type_quat.inl"
178 #endif//GLM_EXTERNAL_TEMPLATE
GLM_FUNC_DECL vec< 3, T, Q > eulerAngles(qua< T, Q > const &x)
Returns euler angles, pitch as x, yaw as y, roll as z.
GLM_FUNC_DECL T length(qua< T, Q > const &q)
Returns the norm of a quaternions.