Quaternion. More...

#include <mat4.h>

Public Member Functions

 Quaternionx ()
 
 Quaternionx (const Angle &euler_x, const Angle &euler_y, const Angle &euler_z, EulerOrder order)
 
 Quaternionx (const Mat4< Type > &rotation_matrix)
 
 Quaternionx (const Quaternionx< Type > &copy)
 
 Quaternionx (const Vec3< Type > &euler, AngleUnit unit, EulerOrder order)
 
 Quaternionx (Type euler_x, Type euler_y, Type euler_z, AngleUnit unit, EulerOrder order)
 
 Quaternionx (Type real, const Vec3< Type > &imag)
 
 Quaternionx (Type real, Type i, Type j, Type k)
 
Attributes
Mat4< Type > to_matrix () const
 Convert the quaternion to a rotation matrix. More...
 
Type magnitude () const
 Get the quaternion magnitude. More...
 
Operators
Quaternionx< Type > operator* (const Quaternionx< Type > &mult) const
 Multiplication operator. More...
 
Quaternionx< Type > operator* (const Mat4< Type > &matrix) const
 
bool operator< (const Quaternionx< Type > &other) const
 Less operator. More...
 
bool operator> (const Quaternionx< Type > &other) const
 Greater operator. More...
 
bool operator<= (const Quaternionx< Type > &other) const
 Less equal operator. More...
 
bool operator>= (const Quaternionx< Type > &other) const
 Greater equal operator. More...
 
bool operator== (const Quaternionx< Type > &other) const
 Equal operator. More...
 
bool operator!= (const Quaternionx< Type > &other) const
 Not equal operator. More...
 

Static Public Member Functions

static Quaternionx< Type > axis_angle (const Angle &angle, const Vec3f &axis)
 
static Quaternionx< Type > lerp (const Quaternionx< Type > &quaternion_initial, const Quaternionx< Type > &quaternion_final, Type lerp_time)
 Linear Quaternion Interpolation. More...
 
static Quaternionx< Type > multiply (const Quaternionx< Type > &quaternion_1, const Quaternionx< Type > &quaternion_2)
 
static Quaternionx< Type > rotation_between (Vec3< Type > v0, Vec3< Type > v1)
 Calculates the shortest arc quaternion between two vectors. More...
 
static Quaternionx< Type > rotation_between (Vec4< Type > v0, Vec4< Type > v1)
 Calculates the shortest arc quaternion between two vectors. More...
 
static Quaternionx< Type > slerp (const Quaternionx< Type > &quaternion_initial, const Quaternionx< Type > &quaternion_final, Type slerp_time)
 Spherical Quaternion Interpolation. More...
 

Public Attributes

union {
   Type   clan::Quaternionx< Type >::i
 
   Type   clan::Quaternionx< Type >::x
 
}; 
 The imaginary vector part. More...
 
union {
   Type   clan::Quaternionx< Type >::j
 
   Type   clan::Quaternionx< Type >::y
 
}; 
 
union {
   Type   clan::Quaternionx< Type >::k
 
   Type   clan::Quaternionx< Type >::z
 
}; 
 
Type w
 The real scalar part. More...
 

Operations

void set (Type euler_x, Type euler_y, Type euler_z, AngleUnit unit, EulerOrder order)
 
void set (const Vec3< Type > &euler, AngleUnit unit, EulerOrder order)
 
void set (const Angle &euler_x, const Angle &euler_y, const Angle &euler_z, EulerOrder order)
 
Quaternionx< Type > & rotate (const Angle &angle, const Vec3f &axis)
 
Quaternionx< Type > & rotate (const Angle &euler_x, const Angle &euler_y, const Angle &euler_z, EulerOrder order)
 
Quaternionx< Type > & normalize ()
 Normalizes this quaternion. More...
 
Quaternionx< Type > & inverse ()
 Inverse this quaternion. More...
 
Vec3< Type > rotate_vector (const Vec3< Type > &v) const
 Rotates vector by this quaternion. More...
 
Vec4< Type > rotate_vector (const Vec4< Type > &v) const
 
static Quaternionx< Type > normalize (Quaternionx< Type > q)
 Normalizes this quaternion. More...
 
static Quaternionx< Type > inverse (Quaternionx< Type > q)
 Inverse this quaternion. More...
 

Detailed Description

template<typename Type>
class clan::Quaternionx< Type >

Quaternion.

These quaternion templates are defined for: float (Quaternionf), double (Quaterniond)


The documentation for this class was generated from the following files: