vmmlib  1.10.0
Templatized C++ vector and matrix math library
vmml::quaternion< T > Class Template Reference
+ Collaboration diagram for vmml::quaternion< T >:

Public Types

typedef vector< 3, T > vec3
 

Public Member Functions

 quaternion ()
 Construct an identity quaternion.
 
 quaternion (T x, T y, T z, T w)
 
 quaternion (T angle, vec3 axis)
 Construct a rotation quaternion.
 
template<size_t M>
 quaternion (const matrix< M, M, T > &rotation_matrix_, typename enable_if< M >=3 >::type *=0)
 
bool equals (const quaternion &other, T tolerance=std::numeric_limits< T >::epsilon()) const
 
x () const
 
y () const
 
z () const
 
w () const
 
void zero ()
 
void identity ()
 
template<size_t D>
void set (const matrix< D, D, T > &rotation_matrix_)
 
bool operator== (const T &a) const
 
bool operator!= (const T &a) const
 
bool operator== (const quaternion &a) const
 
bool operator!= (const quaternion &a) const
 
bool is_akin (const quaternion &a, const T &delta=std::numeric_limits< T >::epsilon())
 
void conjugate ()
 
quaternion get_conjugate () const
 
abs () const
 
squared_abs () const
 
normalize ()
 
quaternion get_normalized () const
 
quaternion negate () const
 
quaternion operator- () const
 
quaternionoperator= (const quaternion &other)
 
quaternion operator+ (const quaternion< T > &a) const
 
quaternion operator- (const quaternion< T > &a) const
 
quaternion operator* (const quaternion< T > &a) const
 
void operator+= (const quaternion< T > &a)
 
void operator-= (const quaternion< T > &a)
 
void operator*= (const quaternion< T > &a)
 
quaternion operator* (T a) const
 
quaternion operator/ (T a) const
 
void operator*= (T a)
 
void operator/= (T a)
 
vector< 3, T > cross (const quaternion< T > &b) const
 
dot (const quaternion< T > &a) const
 
quaternion inverse ()
 
void normal (const quaternion &aa, const quaternion &bb, const quaternion &cc, const quaternion &dd)
 
quaternion normal (const quaternion &aa, const quaternion &bb, const quaternion &cc)
 
matrix< 3, 3, T > get_rotation_matrix () const
 
template<size_t D>
void get_rotation_matrix (matrix< D, D, T > &result) const
 

Static Public Member Functions

static T dot (const quaternion< T > &a, const quaternion< T > &b)
 
static quaternion slerp (T a, const quaternion &p, const quaternion &q, const T epsilon=1e-13)
 

Static Public Attributes

static const quaternion IDENTITY
 
static const quaternion QUATERI
 
static const quaternion QUATERJ
 
static const quaternion QUATERK
 

Friends

std::ostream & operator<< (std::ostream &os, const quaternion &q)
 

Detailed Description

template<typename T>
class vmml::quaternion< T >

Definition at line 57 of file quaternion.hpp.

Member Function Documentation

template<typename T >
bool vmml::quaternion< T >::equals ( const quaternion< T > &  other,
tolerance = std::numeric_limits< T >::epsilon( ) 
) const
Returns
true if the two quaternion are similar.

Definition at line 228 of file quaternion.hpp.


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