iaux::iaQuaternion< T > Class Template Reference

#include <iaQuaternion.h>

Public Member Functions

 iaQuaternion ()
 
 iaQuaternion (T w, T x, T y, T z)
 
 iaQuaternion (T x, T y, T z)
 
 iaQuaternion (const iaQuaternion< T > &other)
 
void toAxisAngle (iaVector3< T > &axis, T &angle) const
 
void set (T w, T x, T y, T z)
 
void identity ()
 
void negate ()
 
const iaVector3< T > toEuler () const
 
const iaMatrix< T > toMatrix () const
 
iaQuaternion< T > & operator= (const iaQuaternion< T > &other)
 
bool operator== (const iaQuaternion< T > &other) const
 
bool operator!= (const iaQuaternion< T > &other) const
 
const iaQuaternion< T > operator+ (const iaQuaternion< T > &other)
 
iaQuaternion< T > & operator+= (const iaQuaternion< T > &other)
 
const iaQuaternion< T > operator- (const iaQuaternion< T > &other)
 
iaQuaternion< T > & operator-= (const iaQuaternion< T > &other)
 
const iaQuaternion< T > operator* (const iaQuaternion< T > &other) const
 
iaQuaternion< T > & operator*= (const iaQuaternion< T > &other)
 
const iaQuaternion< T > operator* (T scalar)
 
iaQuaternion< T > & operator*= (T scalar)
 
const iaQuaternion< T > inverse () const
 
const iaVector3< T > rotate (const iaVector3< T > &vec) const
 
const iaQuaternion< T > normalize () const
 
dot (const iaQuaternion< T > &other) const
 
norm () const
 
normSquared () const
 
const iaQuaternion< T > conjugate () const
 
magnitude2 () const
 
const T * getData () const
 
T * getData ()
 

Static Public Member Functions

static const iaQuaternion< T > fromAxisAngle (const iaVector3< T > &axis, T angle)
 
static const iaQuaternion< T > fromEuler (T pitch, T yaw, T roll)
 
static const iaQuaternion< T > fromEuler (const iaVector3< T > &vec)
 

Public Attributes

_w = 1.0
 
_x = 0.0
 
_y = 0.0
 
_z = 0.0
 

Detailed Description

template<class T>
class iaux::iaQuaternion< T >

quaternion class

x-axis -> pitch y-axis -> yaw z-axis -> roll

Constructor & Destructor Documentation

◆ iaQuaternion() [1/4]

template<class T >
iaQuaternion::iaQuaternion ( )

◆ iaQuaternion() [2/4]

template<class T >
iaQuaternion::iaQuaternion ( w,
x,
y,
z 
)

ctor by direct values

Parameters
wthe w component
xthe x component
ythe y component
zthe z component

◆ iaQuaternion() [3/4]

template<class T >
iaQuaternion::iaQuaternion ( x,
y,
z 
)

ctor by direct values

Parameters
xthe x component
ythe y component
zthe z component

◆ iaQuaternion() [4/4]

template<class T >
iaQuaternion::iaQuaternion ( const iaQuaternion< T > &  other)

init with other quaternion

Parameters
otherthe other quaternion

Member Function Documentation

◆ conjugate()

template<class T >
const iaQuaternion< T > iaQuaternion::conjugate ( ) const
Returns
conjugate

◆ dot()

template<class T >
T iaQuaternion::dot ( const iaQuaternion< T > &  other) const

dot product

◆ fromAxisAngle()

template<class T >
const iaQuaternion< T > iaQuaternion::fromAxisAngle ( const iaVector3< T > &  axis,
angle 
)
static

set by axis angle

Parameters
axisthe axis to rotate around
anglethe angle to rotate

◆ fromEuler() [1/2]

template<class T >
const iaQuaternion< T > iaQuaternion::fromEuler ( const iaVector3< T > &  vec)
static

set by euler angles

vector will be interpreted as pitch, yaw, roll

using order XYZ or pitch,yaw,roll

Parameters
vecvector that contains euler angles

◆ fromEuler() [2/2]

template<class T >
const iaQuaternion< T > iaQuaternion::fromEuler ( pitch,
yaw,
roll 
)
static

set by euler angles

using order XYZ or pitch,yaw,roll

Parameters
pitchrotation around x axis in rad
yawrotation around y axis in rad
rollrotation around z axis in rad

◆ getData() [1/2]

template<class T >
IGOR_INLINE T * iaQuaternion::getData ( )
Returns
pointer to the data

◆ getData() [2/2]

template<class T >
IGOR_INLINE const T * iaQuaternion::getData ( ) const
Returns
pointer to the data

◆ identity()

template<class T >
void iaQuaternion::identity ( )

reset quaternion to identity

◆ inverse()

template<class T >
const iaQuaternion< T > iaQuaternion::inverse ( ) const

◆ magnitude2()

template<class T >
T iaQuaternion::magnitude2 ( ) const
Returns
squared magnitude

◆ negate()

template<class T >
void iaQuaternion::negate ( )

negate quaternion

◆ norm()

template<class T >
IGOR_INLINE T iaQuaternion::norm ( ) const

◆ normalize()

template<class T >
IGOR_INLINE const iaQuaternion< T > iaQuaternion::normalize ( ) const
Returns
a normalized quaternion

◆ normSquared()

template<class T >
T iaQuaternion::normSquared ( ) const

◆ operator!=()

template<class T >
bool iaQuaternion::operator!= ( const iaQuaternion< T > &  other) const
Returns
true if both quaternions are not equal
Parameters
otherthe right hand side quaternion

◆ operator*() [1/2]

template<class T >
const iaQuaternion< T > iaQuaternion::operator* ( const iaQuaternion< T > &  other) const

multiply one quaternion to this quaternion

Parameters
otherthe right hand side quaternion
Returns
the resulting quaternion

◆ operator*() [2/2]

template<class T >
const iaQuaternion< T > iaQuaternion::operator* ( scalar)

multiply quaternion with scalar

Parameters
scalarright hand side the scalar value
Returns
resulting quaternion

◆ operator*=() [1/2]

template<class T >
iaQuaternion< T > & iaQuaternion::operator*= ( const iaQuaternion< T > &  other)

multiply one quaternion with an other one

Parameters
otherthe right hand side quaternion
Returns
resulting quaternion

◆ operator*=() [2/2]

template<class T >
iaQuaternion< T > & iaQuaternion::operator*= ( scalar)

multiplies quaternion with scalar

Parameters
scalarright hand side scalar value

◆ operator+()

template<class T >
const iaQuaternion< T > iaQuaternion::operator+ ( const iaQuaternion< T > &  other)

add one quaternion to an other

Returns
the resulting quaternion
Parameters
otherthe right hand side quaternion

◆ operator+=()

template<class T >
iaQuaternion< T > & iaQuaternion::operator+= ( const iaQuaternion< T > &  other)

add one quaternion to this quaternion

Parameters
otherthe right hand side quaternion
Returns
resulting quaternion

◆ operator-()

template<class T >
const iaQuaternion< T > iaQuaternion::operator- ( const iaQuaternion< T > &  other)

subtracts one quaternion from an other

Returns
the resulting quaternion
Parameters
otherthe right hand side quaternion

◆ operator-=()

template<class T >
iaQuaternion< T > & iaQuaternion::operator-= ( const iaQuaternion< T > &  other)

subtracts one quaternion from the other

Parameters
otherthe right hand side quaternion
Returns
resulting quaternion

◆ operator=()

template<class T >
iaQuaternion< T > & iaQuaternion::operator= ( const iaQuaternion< T > &  other)
Returns
true if both quaternions are equal
Parameters
otherthe right hand side quaternion

◆ operator==()

template<class T >
bool iaQuaternion::operator== ( const iaQuaternion< T > &  other) const
Returns
true if both quaternions are equal
Parameters
otherthe right hand side quaternion

◆ rotate()

template<class T >
const iaVector3< T > iaQuaternion::rotate ( const iaVector3< T > &  vec) const

rotates a given vector

Parameters
vecthe given vector
Returns
rotated vector

◆ set()

template<class T >
void iaQuaternion::set ( w,
x,
y,
z 
)

set by direct value

Parameters
xthe x component
ythe y component
zthe z component
wthe w component

◆ toAxisAngle()

template<class T >
void iaQuaternion::toAxisAngle ( iaVector3< T > &  axis,
T &  angle 
) const

returns axis angle from quaternion

Parameters
axis[out]the rotation axis
angle[out]the rotation angle

◆ toEuler()

template<class T >
const iaVector3< T > iaQuaternion::toEuler ( ) const
Returns
euler angles

!!! terrible percision don't use unless you have to !!!

◆ toMatrix()

template<class T >
const iaMatrix< T > iaQuaternion::toMatrix ( ) const
Returns
a matrix withthe orientation of this quaternion

Member Data Documentation

◆ _w

template<class T >
T iaux::iaQuaternion< T >::_w = 1.0

w component

◆ _x

template<class T >
T iaux::iaQuaternion< T >::_x = 0.0

x component

◆ _y

template<class T >
T iaux::iaQuaternion< T >::_y = 0.0

y component

◆ _z

template<class T >
T iaux::iaQuaternion< T >::_z = 0.0

z component


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