# quaternion.hpp Source File

gtc/quaternion.hpp
Go to the documentation of this file.
#ifndef GLM_GTC_quaternion
#define GLM_GTC_quaternion GLM_VERSION
// Dependency:
#include "../glm.hpp"
#include "../gtc/half_float.hpp"
#include "../gtc/constants.hpp"
#if(defined(GLM_MESSAGES) && !defined(glm_ext))
# pragma message("GLM: GLM_GTC_quaternion extension included")
#endif
namespace glm{
namespace detail
{
template <typename T>
struct tquat// : public genType<T, tquat>
{
enum ctor{null};
typedef T value_type;
typedef std::size_t size_type;
public:
value_type x, y, z, w;
GLM_FUNC_DECL size_type length() const;
// Constructors
tquat();
explicit tquat(
value_type const & s,
glm::detail::tvec3<T> const & v);
explicit tquat(
value_type const & w,
value_type const & x,
value_type const & y,
value_type const & z);
// Convertions
explicit tquat(
tvec3<T> const & eulerAngles);
explicit tquat(
tmat3x3<T> const & m);
explicit tquat(
tmat4x4<T> const & m);
// Accesses
value_type & operator[](int i);
value_type const & operator[](int i) const;
// Operators
tquat<T> & operator*=(value_type const & s);
tquat<T> & operator/=(value_type const & s);
};
template <typename T>
detail::tquat<T> operator- (
detail::tquat<T> const & q);
template <typename T>
detail::tquat<T> operator+ (
detail::tquat<T> const & q,
detail::tquat<T> const & p);
template <typename T>
detail::tquat<T> operator* (
detail::tquat<T> const & q,
detail::tquat<T> const & p);
template <typename T>
detail::tvec3<T> operator* (
detail::tquat<T> const & q,
detail::tvec3<T> const & v);
template <typename T>
detail::tvec3<T> operator* (
detail::tvec3<T> const & v,
detail::tquat<T> const & q);
template <typename T>
detail::tvec4<T> operator* (
detail::tquat<T> const & q,
detail::tvec4<T> const & v);
template <typename T>
detail::tvec4<T> operator* (
detail::tvec4<T> const & v,
detail::tquat<T> const & q);
template <typename T>
detail::tquat<T> operator* (
detail::tquat<T> const & q,
typename detail::tquat<T>::value_type const & s);
template <typename T>
detail::tquat<T> operator* (
typename detail::tquat<T>::value_type const & s,
detail::tquat<T> const & q);
template <typename T>
detail::tquat<T> operator/ (
detail::tquat<T> const & q,
typename detail::tquat<T>::value_type const & s);
} //namespace detail
template <typename T>
T length(
detail::tquat<T> const & q);
template <typename T>
detail::tquat<T> normalize(
detail::tquat<T> const & q);
template <typename T>
T dot(
detail::tquat<T> const & q1,
detail::tquat<T> const & q2);
template <typename T>
detail::tquat<T> mix(
detail::tquat<T> const & x,
detail::tquat<T> const & y,
T const & a);
template <typename T>
detail::tquat<T> lerp(
detail::tquat<T> const & x,
detail::tquat<T> const & y,
T const & a);
template <typename T>
detail::tquat<T> slerp(
detail::tquat<T> const & x,
detail::tquat<T> const & y,
T const & a);
template <typename T>
detail::tquat<T> conjugate(
detail::tquat<T> const & q);
template <typename T>
detail::tquat<T> inverse(
detail::tquat<T> const & q);
template <typename T>
detail::tquat<T> rotate(
detail::tquat<T> const & q,
typename detail::tquat<T>::value_type const & angle,
detail::tvec3<T> const & axis);
template <typename T>
detail::tvec3<T> eulerAngles(
detail::tquat<T> const & x);
template <typename valType>
valType roll(
detail::tquat<valType> const & x);
template <typename valType>
valType pitch(
detail::tquat<valType> const & x);
template <typename valType>
valType yaw(
detail::tquat<valType> const & x);
template <typename T>
detail::tmat3x3<T> mat3_cast(
detail::tquat<T> const & x);
template <typename T>
detail::tmat4x4<T> mat4_cast(
detail::tquat<T> const & x);
template <typename T>
detail::tquat<T> quat_cast(
detail::tmat3x3<T> const & x);
template <typename T>
detail::tquat<T> quat_cast(
detail::tmat4x4<T> const & x);
template <typename valType>
valType angle(
detail::tquat<valType> const & x);
template <typename valType>
detail::tvec3<valType> axis(
detail::tquat<valType> const & x);
template <typename valType>
detail::tquat<valType> angleAxis(
valType const & angle,
valType const & x,
valType const & y,
valType const & z);
template <typename valType>
detail::tquat<valType> angleAxis(
valType const & angle,
detail::tvec3<valType> const & axis);
typedef detail::tquat<float> quat;
typedef detail::tquat<detail::half> hquat;
typedef detail::tquat<float> fquat;
typedef detail::tquat<double> dquat;
typedef detail::tquat<lowp_float> lowp_quat;
typedef detail::tquat<mediump_float> mediump_quat;
typedef detail::tquat<highp_float> highp_quat;
} //namespace glm
#include "quaternion.inl"
#endif//GLM_GTC_quaternion