Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
quat Struct Reference

quaternions are number systems that extend complex numbers complex numbers extend the number system of real numbers in a way so x=-1 can be solved in this example x = i (imaginary). More...

#include <geom.hpp>

Inheritance diagram for quat:
vec4

Public Member Functions

 quat ()
 
 quat (float x, float y, float z, float w)
 
 quat (const vec &axis, float angle)
 
 quat (const vec &v)
 
 quat (const matrix3 &m)
 
 quat (const matrix4x3 &m)
 
 quat (const matrix4 &m)
 
void restorew ()
 
quatadd (const vec4 &o)
 
quatsub (const vec4 &o)
 
quatmul (float k)
 
quatmul (const quat &p, const quat &o)
 
quatmul (const quat &o)
 
quatinvert ()
 
void calcangleaxis (float &angle, vec &axis)
 
vec rotate (const vec &v) const
 
vec invertedrotate (const vec &v) const
 
template<class M >
void convertmatrix (const M &m)
 
float & operator[] (int i)
 operators for XYZ coordinate access More...
 
float operator[] (int i) const
 
template<class T >
float dot3 (const T &o) const
 dot products More...
 
float dot (const vec4 &o) const
 
float dot (const vec &o) const
 
float squaredlen () const
 
float magnitude () const
 
float magnitude3 () const
 
vec4normalize ()
 
vec4lerp (const vec4 &b, float t)
 
vec4lerp (const vec4 &a, const vec4 &b, float t)
 
vec4mul3 (float f)
 basic algebraic methods More...
 
vec4mul (const vec4 &o)
 
vec4div3 (float f)
 
vec4div (float f)
 
vec4div (const vec4 &o)
 
vec4addw (float f)
 
vec4subw (float f)
 
vec4neg3 ()
 
vec4neg ()
 
template<class B >
vec4madd (const vec4 &a, const B &b)
 
template<class B >
vec4msub (const vec4 &a, const B &b)
 
void setxyz (const vec &v)
 
vec4rotate_around_z (float c, float s)
 rotation members More...
 
vec4rotate_around_z (float angle)
 
vec4rotate_around_x (float c, float s)
 
vec4rotate_around_x (float angle)
 
vec4rotate_around_y (float c, float s)
 
vec4rotate_around_y (float angle)
 

Public Attributes

union {
   struct {
float x
 
float y
 
float z
 
float w
 
   } 
 
   struct {
float r
 
float g
 
float b
 
float a
 
   } 
 
float v [4]
 
}; 
 

Detailed Description

quaternions are number systems that extend complex numbers complex numbers extend the number system of real numbers in a way so x=-1 can be solved in this example x = i (imaginary).

As you shoud know complex numbers have a real and an imaginary part. in quarterions, xy is NOT yx: xy != yx; but i = k = j = ijk = -1 some calculations can be done much easier if you consider this extra condition/dimension

Constructor & Destructor Documentation

quat::quat ( )
inline

Referenced by mul().

quat::quat ( float  x,
float  y,
float  z,
float  w 
)
inline
quat::quat ( const vec axis,
float  angle 
)
inline
quat::quat ( const vec v)
inlineexplicit

References restorew().

quat::quat ( const matrix3 m)
inlineexplicit

References convertmatrix().

quat::quat ( const matrix4x3 m)
inlineexplicit

References convertmatrix().

quat::quat ( const matrix4 m)
inlineexplicit

References convertmatrix().

Member Function Documentation

quat& quat::add ( const vec4 o)
inline
vec4& vec4::addw ( float  f)
inlineinherited

References f().

void quat::calcangleaxis ( float &  angle,
vec axis 
)
inline

References vec4::dot3(), and vec::mul().

template<class M >
void quat::convertmatrix ( const M &  m)
inline

Referenced by quat().

vec4& vec4::div ( float  f)
inlineinherited

References vec4::div3(), and f().

vec4& vec4::div ( const vec4 o)
inlineinherited
vec4& vec4::div3 ( float  f)
inlineinherited

References f().

Referenced by vec4::div().

float vec4::dot ( const vec4 o) const
inlineinherited
float vec4::dot ( const vec o) const
inlineinherited
template<class T >
float vec4::dot3 ( const T &  o) const
inlineinherited
quat& quat::invert ( )
inline

References vec4::neg3().

Referenced by dualquat::invert(), and dualquat::mulorient().

vec quat::invertedrotate ( const vec v) const
inline
vec4& vec4::lerp ( const vec4 b,
float  t 
)
inlineinherited

Referenced by squat::lerp().

vec4& vec4::lerp ( const vec4 a,
const vec4 b,
float  t 
)
inlineinherited
template<class B >
vec4& vec4::madd ( const vec4 a,
const B &  b 
)
inlineinherited
float vec4::magnitude ( ) const
inlineinherited
float vec4::magnitude3 ( ) const
inlineinherited

References vec4::dot3().

template<class B >
vec4& vec4::msub ( const vec4 a,
const B &  b 
)
inlineinherited
vec4& vec4::mul ( const vec4 o)
inlineinherited
quat& quat::mul ( float  k)
inline
quat& quat::mul ( const quat p,
const quat o 
)
inline
quat& quat::mul ( const quat o)
inline

References mul(), and quat().

Referenced by mul().

vec4& vec4::mul3 ( float  f)
inlineinherited

basic algebraic methods

References f().

Referenced by animmodel::mesh::fixqtangent(), and vec4::mul().

vec4& vec4::neg ( )
inlineinherited
vec4& vec4::neg3 ( )
inlineinherited

Referenced by invert(), and vec4::neg().

vec4& vec4::normalize ( )
inlineinherited
float& vec4::operator[] ( int  i)
inlineinherited

operators for XYZ coordinate access

float vec4::operator[] ( int  i) const
inlineinherited
void quat::restorew ( )
inline
vec quat::rotate ( const vec v) const
inline
vec4& vec4::rotate_around_x ( float  c,
float  s 
)
inlineinherited
vec4& vec4::rotate_around_x ( float  angle)
inlineinherited
vec4& vec4::rotate_around_y ( float  c,
float  s 
)
inlineinherited
vec4& vec4::rotate_around_y ( float  angle)
inlineinherited
vec4& vec4::rotate_around_z ( float  c,
float  s 
)
inlineinherited

rotation members

vec4& vec4::rotate_around_z ( float  angle)
inlineinherited
void vec4::setxyz ( const vec v)
inlineinherited

Referenced by matrix4::settranslation().

float vec4::squaredlen ( ) const
inlineinherited

References vec4::dot().

Referenced by vec4::magnitude(), and matrix4x3::matrix4x3().

quat& quat::sub ( const vec4 o)
inline
vec4& vec4::subw ( float  f)
inlineinherited

References f().

Member Data Documentation

union { ... }

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