ALBA
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
albaQuaternion Class Reference

#include <albaQuaternion.h>

Public Member Functions

 albaQuaternion ()
 
 albaQuaternion (double w, double x, double y, double z)
 
 albaQuaternion (double angle, albaVect3d &axis)
 
 albaQuaternion (albaMatrix &matr)
 
albaMatrix ToMatrix ()
 
void AngleAxis (double &angle, albaVect3d &axis)
 
void Zero ()
 
void Identity ()
 
void Add (albaQuaternion &q)
 
void Subtract (albaQuaternion &q)
 
void Multiply (double s)
 
void Divide (double s)
 
void Multiply (albaQuaternion &q)
 
void Multiply (albaQuaternion &q, albaQuaternion &result)
 
albaQuaternion Dot (albaQuaternion &q)
 
void Dot (albaQuaternion &q, albaQuaternion &result)
 
albaQuaternion Conjugate ()
 
void Conjugate (albaQuaternion &result)
 
double GetLength ()
 
double GetNorm ()
 
void Normalize ()
 
bool Normalized ()
 
albaQuaternion Inverse ()
 
void Inverse (albaQuaternion &result)
 
bool operator== (albaQuaternion &other)
 
bool operator!= (albaQuaternion &other)
 
double & operator[] (int i)
 
albaQuaternion operator+ (albaQuaternion b)
 
albaQuaternion operator- (albaQuaternion b)
 
albaQuaternion operator* (albaQuaternion b)
 
albaQuaternionoperator+= (albaQuaternion b)
 
albaQuaternionoperator-= (albaQuaternion b)
 
albaQuaternionoperator*= (const albaQuaternion b)
 
bool operator== (double scalar)
 
bool operator!= (double scalar)
 
albaQuaternion operator- ()
 
albaQuaternion operator* (double s)
 
albaQuaternion operator/ (double s)
 
albaQuaternionoperator*= (double s)
 
albaQuaternionoperator/= (double s)
 

Static Public Member Functions

static albaQuaternion Slerp (albaQuaternion &a, albaQuaternion &b, double t)
 

Protected Attributes

double m_W
 
double m_X
 
double m_Y
 
double m_Z
 

Detailed Description

A quaternion.

This quaternion class is generic and may be non-unit, however most anticipated uses of quaternions are typically unit cases representing a rotation 2*acos(w) about the axis (x,y,z).

Definition at line 35 of file albaQuaternion.h.

Constructor & Destructor Documentation

◆ albaQuaternion() [1/4]

albaQuaternion::albaQuaternion ( )

Default constructor.

◆ albaQuaternion() [2/4]

albaQuaternion::albaQuaternion ( double  w,
double  x,
double  y,
double  z 
)

Constructor quaternion from real component w and imaginary x,y,z.

◆ albaQuaternion() [3/4]

albaQuaternion::albaQuaternion ( double  angle,
albaVect3d axis 
)

Construct quaternion from angle - axis.

◆ albaQuaternion() [4/4]

albaQuaternion::albaQuaternion ( albaMatrix matr)

Construct quaternion from rotation albaMatrix.

Member Function Documentation

◆ ToMatrix()

albaMatrix albaQuaternion::ToMatrix ( )

Convert quaternion to albaMatrix.

◆ AngleAxis()

void albaQuaternion::AngleAxis ( double &  angle,
albaVect3d axis 
)

Convert quaternion to angle - axis.

◆ Zero()

void albaQuaternion::Zero ( )

Set quaternion to zero.

◆ Identity()

void albaQuaternion::Identity ( )

Set quaternion to identity.

◆ Add()

void albaQuaternion::Add ( albaQuaternion q)

Add another quaternion to this quaternion.

◆ Subtract()

void albaQuaternion::Subtract ( albaQuaternion q)

Subtract another quaternion from this quaternion.

◆ Multiply() [1/3]

void albaQuaternion::Multiply ( double  s)

Multiply this quaternion by a scalar.

◆ Divide()

void albaQuaternion::Divide ( double  s)

Divide this quaternion by a scalar.

◆ Multiply() [2/3]

void albaQuaternion::Multiply ( albaQuaternion q)

Multiply this quaternion with another quaternion.

◆ Multiply() [3/3]

void albaQuaternion::Multiply ( albaQuaternion q,
albaQuaternion result 
)

Multiply this quaternion with another quaternion and store result in parameter.

◆ Dot() [1/2]

albaQuaternion albaQuaternion::Dot ( albaQuaternion q)

Dot product of two quaternions.

◆ Dot() [2/2]

void albaQuaternion::Dot ( albaQuaternion q,
albaQuaternion result 
)

Dot product of two quaternions writing result to parameter.

◆ Conjugate() [1/2]

albaQuaternion albaQuaternion::Conjugate ( )

Calculate conjugate of quaternion.

◆ Conjugate() [2/2]

void albaQuaternion::Conjugate ( albaQuaternion result)

Calculate conjugate of quaternion and store result in parameter.

◆ GetLength()

double albaQuaternion::GetLength ( )

Calculate and returns the length of quaternion.

◆ GetNorm()

double albaQuaternion::GetNorm ( )

Calculate and returns the norm of quaternion.

◆ Normalize()

void albaQuaternion::Normalize ( )

Normalize the quaternion.

◆ Normalized()

bool albaQuaternion::Normalized ( )

return true if the quaternion is normalized

◆ Inverse() [1/2]

albaQuaternion albaQuaternion::Inverse ( )

Calculate inverse of quaternion.

◆ Inverse() [2/2]

void albaQuaternion::Inverse ( albaQuaternion result)

Calculate inverse of quaternion and store result in parameter.

◆ Slerp()

static albaQuaternion albaQuaternion::Slerp ( albaQuaternion a,
albaQuaternion b,
double  t 
)
static

Spherical linear interpolation.

◆ operator==() [1/2]

bool albaQuaternion::operator== ( albaQuaternion other)

Equals operator.

◆ operator!=() [1/2]

bool albaQuaternion::operator!= ( albaQuaternion other)

Not equals operator.

◆ operator[]()

double & albaQuaternion::operator[] ( int  i)

◆ operator+()

albaQuaternion albaQuaternion::operator+ ( albaQuaternion  b)

◆ operator-() [1/2]

albaQuaternion albaQuaternion::operator- ( albaQuaternion  b)

◆ operator*() [1/2]

albaQuaternion albaQuaternion::operator* ( albaQuaternion  b)

◆ operator+=()

albaQuaternion & albaQuaternion::operator+= ( albaQuaternion  b)

◆ operator-=()

albaQuaternion & albaQuaternion::operator-= ( albaQuaternion  b)

◆ operator*=() [1/2]

albaQuaternion & albaQuaternion::operator*= ( const albaQuaternion  b)

◆ operator==() [2/2]

bool albaQuaternion::operator== ( double  scalar)

◆ operator!=() [2/2]

bool albaQuaternion::operator!= ( double  scalar)

◆ operator-() [2/2]

albaQuaternion albaQuaternion::operator- ( )

◆ operator*() [2/2]

albaQuaternion albaQuaternion::operator* ( double  s)

◆ operator/()

albaQuaternion albaQuaternion::operator/ ( double  s)

◆ operator*=() [2/2]

albaQuaternion & albaQuaternion::operator*= ( double  s)

◆ operator/=()

albaQuaternion & albaQuaternion::operator/= ( double  s)

Member Data Documentation

◆ m_W

double albaQuaternion::m_W
protected

w component of quaternion

Definition at line 136 of file albaQuaternion.h.

◆ m_X

double albaQuaternion::m_X
protected

x component of quaternion

Definition at line 137 of file albaQuaternion.h.

◆ m_Y

double albaQuaternion::m_Y
protected

y component of quaternion

Definition at line 138 of file albaQuaternion.h.

◆ m_Z

double albaQuaternion::m_Z
protected

z component of quaternion

Definition at line 139 of file albaQuaternion.h.


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