Professional Documents
Culture Documents
Type Quat
Type Quat
hpp
/// @ref core
/// @file glm/detail/type_quat.hpp
#pragma once
// Dependency:
#include "../detail/type_mat3x3.hpp"
#include "../detail/type_mat4x4.hpp"
#include "../detail/type_vec3.hpp"
#include "../detail/type_vec4.hpp"
#include "../ext/vector_relational.hpp"
#include "../ext/quaternion_relational.hpp"
#include "../gtc/constants.hpp"
#include "../gtc/matrix_transform.hpp"
namespace glm
{
template<typename T, qualifier Q>
struct qua
{
// -- Implementation detail --
// -- Data --
# if GLM_SILENT_WARNINGS == GLM_ENABLE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
# elif GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
# pragma clang diagnostic ignored "-Wnested-anon-types"
# elif GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(push)
# pragma warning(disable: 4201) // nonstandard extension
used : nameless struct/union
# endif
# endif
typename detail::storage<4, T,
detail::is_aligned<Q>::value>::type data;
};
# else
# ifdef GLM_FORCE_QUAT_DATA_WXYZ
T w, x, y, z;
# else
T x, y, z, w;
# endif
# endif
# if GLM_SILENT_WARNINGS == GLM_ENABLE
# if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
# elif GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic pop
# elif GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(pop)
# endif
# endif
// -- Component accesses --
// -- Conversion constructors --
/// Build a quaternion from euler angles (pitch, yaw, roll), in radians.
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT qua(vec<3, T, Q> const&
eulerAngles);
GLM_FUNC_DECL GLM_EXPLICIT qua(mat<3, 3, T, Q> const& q);
GLM_FUNC_DECL GLM_EXPLICIT qua(mat<4, 4, T, Q> const& q);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q>& operator=(qua<U, Q>
const& q);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q>& operator+=(qua<U, Q>
const& q);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q>& operator-=(qua<U, Q>
const& q);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q>& operator*=(qua<U, Q>
const& q);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q>& operator*=(U s);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q>& operator/=(U s);
};
// -- Binary operators --
// -- Boolean operators --
#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_quat.inl"
#endif//GLM_EXTERNAL_TEMPLATE