Public Member Functions | Static Public Member Functions | Public Attributes

CL_Quaterniond Class Reference
[clanCore Math]

Quaternion - Double. More...

#include <quaternion.h>

Inheritance diagram for CL_Quaterniond:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CL_Quaterniond ()
 CL_Quaterniond (const CL_Angle &euler_x, const CL_Angle &euler_y, const CL_Angle &euler_z, CL_EulerOrder order)
 CL_Quaterniond (const CL_Vec3< double > &euler, CL_AngleUnit unit, CL_EulerOrder order)
 CL_Quaterniond (double euler_x, double euler_y, double euler_z, CL_AngleUnit unit, CL_EulerOrder order)
 CL_Quaterniond (double real, const CL_Vec3< double > &imag)
 CL_Quaterniond (double real, double i, double j, double k)
 CL_Quaterniond (const CL_Quaternionx< double > &copy)
Operations

CL_Quaternionx< double > & multiply (const CL_Mat4< double > &matrix)
 Multiply this quaternion by a specified matrix.
CL_Quaternionx< double > & multiply (const CL_Quaternionx< double > &quaternion)
 Multiply this quaternion by another quaternion.
void set (doubleeuler_x, doubleeuler_y, doubleeuler_z, CL_AngleUnit unit, CL_EulerOrder order)
void set (const CL_Vec3< double > &euler, CL_AngleUnit unit, CL_EulerOrder order)
void set (const CL_Angle &euler_x, const CL_Angle &euler_y, const CL_Angle &euler_z, CL_EulerOrder order)
CL_Quaternionx< double > & rotate (const CL_Angle &angle, const CL_Vec3f &axis)
CL_Quaternionx< double > & rotate (const CL_Angle &euler_x, const CL_Angle &euler_y, const CL_Angle &euler_z, CL_EulerOrder order)
CL_Quaternionx< double > & normalize ()
 Normalizes this quaternion.
CL_Quaternionx< double > & inverse ()
 Inverse this quaternion.
CL_Vec3< double > rotate_vector (const CL_Vec3< double > &v)
 Rotates vector by this quaternion.
CL_Vec4< double > rotate_vector (const CL_Vec4< double > &v)
Attributes

CL_Mat4< double > to_matrix () const
 Convert the quaternion to a rotation matrix.
double magnitude () const
 Get the quaternion magnitude.
Operators

CL_Quaternionx< double > operator* (const CL_Quaternionx< double > &mult) const
 Multiplication operator.

Static Public Member Functions

static CL_Quaternionx< double > axis_angle (const CL_Angle &angle, const CL_Vec3f &axis)
static CL_Quaternionx< double > lerp (const CL_Quaternionx< double > &quaternion_initial, const CL_Quaternionx< double > &quaternion_final, doublelerp_time)
 Linear Quaternion Interpolation.
static CL_Quaternionx< double > multiply (const CL_Quaternionx< double > &quaternion_1, const CL_Quaternionx< double > &quaternion_2)
static CL_Quaternionx< double > slerp (const CL_Quaternionx< double > &quaternion_initial, const CL_Quaternionx< double > &quaternion_final, doubleslerp_time)
 Spherical Quaternion Interpolation.

Public Attributes

union {
   Type   i
   Type   x
}; 
 The imaginary vector part.
union {
   Type   j
   Type   y
}; 
union {
   Type   k
   Type   z
}; 
double i
double j
double k
double w
 The real scalar part.
double x
double y
double z

Detailed Description

Quaternion - Double.


Constructor & Destructor Documentation

CL_Quaterniond::CL_Quaterniond (  )  [inline]
CL_Quaterniond::CL_Quaterniond ( const CL_Quaternionx< double > &  copy  )  [inline]
CL_Quaterniond::CL_Quaterniond ( double  real,
double  i,
double  j,
double  k 
) [inline]
CL_Quaterniond::CL_Quaterniond ( double  real,
const CL_Vec3< double > &  imag 
) [inline]
CL_Quaterniond::CL_Quaterniond ( double  euler_x,
double  euler_y,
double  euler_z,
CL_AngleUnit  unit,
CL_EulerOrder  order 
) [inline]
CL_Quaterniond::CL_Quaterniond ( const CL_Vec3< double > &  euler,
CL_AngleUnit  unit,
CL_EulerOrder  order 
) [inline]
CL_Quaterniond::CL_Quaterniond ( const CL_Angle euler_x,
const CL_Angle euler_y,
const CL_Angle euler_z,
CL_EulerOrder  order 
) [inline]

Member Function Documentation

static CL_Quaternionx<double > CL_Quaternionx< double >::axis_angle ( const CL_Angle angle,
const CL_Vec3f axis 
) [static, inherited]
CL_Quaternionx<double >& CL_Quaternionx< double >::inverse (  )  [inherited]

Inverse this quaternion.

This is the same as the conjugate of a quaternion

Returns:
reference to this object
static CL_Quaternionx<double > CL_Quaternionx< double >::lerp ( const CL_Quaternionx< double > &  quaternion_initial,
const CL_Quaternionx< double > &  quaternion_final,
double  lerp_time 
) [static, inherited]

Linear Quaternion Interpolation.

Parameters:
quaternion_initial = Source quaternion
quaternion_final = Destination quaternion
lerp_time = Time in the range of 0.0 to 1.0
double CL_Quaternionx< double >::magnitude (  )  const [inherited]

Get the quaternion magnitude.

CL_Quaternionx<double >& CL_Quaternionx< double >::multiply ( const CL_Quaternionx< double > &  quaternion  )  [inherited]

Multiply this quaternion by another quaternion.

This multiplies the quaternion as follows: this = quaternion * this

Parameters:
quaternion = Quaternion to multiply
Returns:
reference to this object
static CL_Quaternionx<double > CL_Quaternionx< double >::multiply ( const CL_Quaternionx< double > &  quaternion_1,
const CL_Quaternionx< double > &  quaternion_2 
) [static, inherited]
CL_Quaternionx<double >& CL_Quaternionx< double >::multiply ( const CL_Mat4< double > &  matrix  )  [inherited]

Multiply this quaternion by a specified matrix.

Parameters:
matrix = Matrix to multiply
Returns:
reference to this object
CL_Quaternionx<double >& CL_Quaternionx< double >::normalize (  )  [inherited]

Normalizes this quaternion.

Returns:
reference to this object
CL_Quaternionx<double > CL_Quaternionx< double >::operator* ( const CL_Quaternionx< double > &  mult  )  const [inline, inherited]

Multiplication operator.

CL_Quaternionx<double >& CL_Quaternionx< double >::rotate ( const CL_Angle angle,
const CL_Vec3f axis 
) [inherited]
CL_Quaternionx<double >& CL_Quaternionx< double >::rotate ( const CL_Angle euler_x,
const CL_Angle euler_y,
const CL_Angle euler_z,
CL_EulerOrder  order 
) [inherited]
CL_Vec4<double > CL_Quaternionx< double >::rotate_vector ( const CL_Vec4< double > &  v  )  [inherited]
CL_Vec3<double > CL_Quaternionx< double >::rotate_vector ( const CL_Vec3< double > &  v  )  [inherited]

Rotates vector by this quaternion.

Parameters:
v = Vertex to rotate
Returns:
rotated vector
void CL_Quaternionx< double >::set ( const CL_Vec3< double > &  euler,
CL_AngleUnit  unit,
CL_EulerOrder  order 
) [inherited]
void CL_Quaternionx< double >::set ( double  euler_x,
double  euler_y,
double  euler_z,
CL_AngleUnit  unit,
CL_EulerOrder  order 
) [inherited]
void CL_Quaternionx< double >::set ( const CL_Angle euler_x,
const CL_Angle euler_y,
const CL_Angle euler_z,
CL_EulerOrder  order 
) [inherited]
static CL_Quaternionx<double > CL_Quaternionx< double >::slerp ( const CL_Quaternionx< double > &  quaternion_initial,
const CL_Quaternionx< double > &  quaternion_final,
double  slerp_time 
) [static, inherited]

Spherical Quaternion Interpolation.

Parameters:
quaternion_initial = Source quaternion
quaternion_final = Destination quaternion
slerp_time = Time in the range of 0.0 to 1.0
CL_Mat4<double > CL_Quaternionx< double >::to_matrix (  )  const [inherited]

Convert the quaternion to a rotation matrix.

This function assumes that the quarternion is normalized.


Member Data Documentation

union { ... } [inherited]

The imaginary vector part.

union { ... } [inherited]
union { ... } [inherited]
double CL_Quaternionx< double >::i [inherited]
double CL_Quaternionx< double >::j [inherited]
double CL_Quaternionx< double >::k [inherited]
double CL_Quaternionx< double >::w [inherited]

The real scalar part.

double CL_Quaternionx< double >::x [inherited]
double CL_Quaternionx< double >::y [inherited]
double CL_Quaternionx< double >::z [inherited]

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