17 #include "../detail/type_mat3x3.hpp" 18 #include "../detail/type_mat4x4.hpp" 19 #include "../detail/type_vec3.hpp" 20 #include "../detail/type_vec4.hpp" 21 #include "../ext/vector_relational.hpp" 22 #include "../ext/quaternion_relational.hpp" 23 #include "../gtc/constants.hpp" 24 #include "../gtc/matrix_transform.hpp" 31 template<
typename T, qualifier Q>
36 typedef qua<T, Q> type;
41 # if GLM_LANG & GLM_LANG_CXXMS_FLAG 44 struct { T x, y, z, w;};
46 typename detail::storage<4, T, detail::is_aligned<Q>::value>::type data;
54 typedef length_t length_type;
56 GLM_FUNC_DECL
static GLM_CONSTEXPR length_type
length(){
return 4;}
58 GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i);
59 GLM_FUNC_DECL GLM_CONSTEXPR T
const& operator[](length_type i)
const;
63 GLM_FUNC_DECL GLM_CONSTEXPR qua() GLM_DEFAULT;
64 GLM_FUNC_DECL GLM_CONSTEXPR qua(qua<T, Q> const& q) GLM_DEFAULT;
66 GLM_FUNC_DECL GLM_CONSTEXPR qua(qua<T, P> const& q);
70 GLM_FUNC_DECL GLM_CONSTEXPR qua(T s, vec<3, T, Q> const& v);
71 GLM_FUNC_DECL GLM_CONSTEXPR qua(T w, T x, T y, T z);
75 template<typename U, qualifier P>
76 GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT qua(qua<U, P> const& q);
79 # if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 80 GLM_FUNC_DECL
explicit operator mat<3, 3, T, Q>();
81 GLM_FUNC_DECL
explicit operator mat<4, 4, T, Q>();
90 GLM_FUNC_DECL qua(vec<3, T, Q>
const& u, vec<3, T, Q>
const& v);
93 GLM_FUNC_DECL GLM_EXPLICIT qua(vec<3, T, Q>
const&
eulerAngles);
94 GLM_FUNC_DECL GLM_EXPLICIT qua(mat<3, 3, T, Q>
const& q);
95 GLM_FUNC_DECL GLM_EXPLICIT qua(mat<4, 4, T, Q>
const& q);
99 GLM_FUNC_DECL qua<T, Q>& operator=(qua<T, Q>
const& q) GLM_DEFAULT;
102 GLM_FUNC_DECL qua<T, Q>& operator=(qua<U, Q>
const& q);
104 GLM_FUNC_DECL qua<T, Q>& operator+=(qua<U, Q>
const& q);
106 GLM_FUNC_DECL qua<T, Q>& operator-=(qua<U, Q>
const& q);
108 GLM_FUNC_DECL qua<T, Q>& operator*=(qua<U, Q>
const& q);
110 GLM_FUNC_DECL qua<T, Q>& operator*=(U s);
112 GLM_FUNC_DECL qua<T, Q>& operator/=(U s);
117 template<
typename T, qualifier Q>
118 GLM_FUNC_DECL qua<T, Q> operator+(qua<T, Q>
const& q);
120 template<
typename T, qualifier Q>
121 GLM_FUNC_DECL qua<T, Q> operator-(qua<T, Q>
const& q);
125 template<
typename T, qualifier Q>
126 GLM_FUNC_DECL qua<T, Q> operator+(qua<T, Q>
const& q, qua<T, Q>
const& p);
128 template<
typename T, qualifier Q>
129 GLM_FUNC_DECL qua<T, Q> operator-(qua<T, Q>
const& q, qua<T, Q>
const& p);
131 template<
typename T, qualifier Q>
132 GLM_FUNC_DECL qua<T, Q> operator*(qua<T, Q>
const& q, qua<T, Q>
const& p);
134 template<
typename T, qualifier Q>
135 GLM_FUNC_DECL vec<3, T, Q> operator*(qua<T, Q>
const& q, vec<3, T, Q>
const& v);
137 template<
typename T, qualifier Q>
138 GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q>
const& v, qua<T, Q>
const& q);
140 template<
typename T, qualifier Q>
141 GLM_FUNC_DECL vec<4, T, Q> operator*(qua<T, Q>
const& q, vec<4, T, Q>
const& v);
143 template<
typename T, qualifier Q>
144 GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q>
const& v, qua<T, Q>
const& q);
146 template<
typename T, qualifier Q>
147 GLM_FUNC_DECL qua<T, Q> operator*(qua<T, Q>
const& q, T
const& s);
149 template<
typename T, qualifier Q>
150 GLM_FUNC_DECL qua<T, Q> operator*(T
const& s, qua<T, Q>
const& q);
152 template<
typename T, qualifier Q>
153 GLM_FUNC_DECL qua<T, Q> operator/(qua<T, Q>
const& q, T
const& s);
157 template<
typename T, qualifier Q>
158 GLM_FUNC_DECL GLM_CONSTEXPR
bool operator==(qua<T, Q>
const& q1, qua<T, Q>
const& q2);
160 template<
typename T, qualifier Q>
161 GLM_FUNC_DECL GLM_CONSTEXPR
bool operator!=(qua<T, Q>
const& q1, qua<T, Q>
const& q2);
166 #include "type_quat.inl" 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.