Public Member Functions | Static Public Member Functions | Public Attributes

CL_Quaternionf Class Reference
[clanCore Math]

Quaternion - Float. More...

#include <quaternion.h>

Inheritance diagram for CL_Quaternionf:
Inheritance graph
[legend]

List of all members.

Public Member Functions

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

CL_Quaternionx< float > & multiply (const CL_Mat4< float > &matrix)
 Multiply this quaternion by a specified matrix.
CL_Quaternionx< float > & multiply (const CL_Quaternionx< float > &quaternion)
 Multiply this quaternion by another quaternion.
void set (floateuler_x, floateuler_y, floateuler_z, CL_AngleUnit unit, CL_EulerOrder order)
void set (const CL_Vec3< float > &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< float > & rotate (const CL_Angle &angle, const CL_Vec3f &axis)
CL_Quaternionx< float > & rotate (const CL_Angle &euler_x, const CL_Angle &euler_y, const CL_Angle &euler_z, CL_EulerOrder order)
CL_Quaternionx< float > & normalize ()
 Normalizes this quaternion.
CL_Quaternionx< float > & inverse ()
 Inverse this quaternion.
CL_Vec3< float > rotate_vector (const CL_Vec3< float > &v)
 Rotates vector by this quaternion.
CL_Vec4< float > rotate_vector (const CL_Vec4< float > &v)
Attributes

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

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

Static Public Member Functions

static CL_Quaternionx< float > axis_angle (const CL_Angle &angle, const CL_Vec3f &axis)
static CL_Quaternionx< float > lerp (const CL_Quaternionx< float > &quaternion_initial, const CL_Quaternionx< float > &quaternion_final, floatlerp_time)
 Linear Quaternion Interpolation.
static CL_Quaternionx< float > multiply (const CL_Quaternionx< float > &quaternion_1, const CL_Quaternionx< float > &quaternion_2)
static CL_Quaternionx< float > slerp (const CL_Quaternionx< float > &quaternion_initial, const CL_Quaternionx< float > &quaternion_final, floatslerp_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
}; 
float i
float j
float k
float w
 The real scalar part.
float x
float y
float z

Detailed Description

Quaternion - Float.


Constructor & Destructor Documentation

CL_Quaternionf::CL_Quaternionf (  )  [inline]
CL_Quaternionf::CL_Quaternionf ( const CL_Quaternionx< float > &  copy  )  [inline]
CL_Quaternionf::CL_Quaternionf ( float  real,
float  i,
float  j,
float  k 
) [inline]
CL_Quaternionf::CL_Quaternionf ( float  real,
const CL_Vec3< float > &  imag 
) [inline]
CL_Quaternionf::CL_Quaternionf ( float  euler_x,
float  euler_y,
float  euler_z,
CL_AngleUnit  unit,
CL_EulerOrder  order 
) [inline]
CL_Quaternionf::CL_Quaternionf ( const CL_Vec3< float > &  euler,
CL_AngleUnit  unit,
CL_EulerOrder  order 
) [inline]
CL_Quaternionf::CL_Quaternionf ( 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<float > CL_Quaternionx< float >::axis_angle ( const CL_Angle angle,
const CL_Vec3f axis 
) [static, inherited]
CL_Quaternionx<float >& CL_Quaternionx< float >::inverse (  )  [inherited]

Inverse this quaternion.

This is the same as the conjugate of a quaternion

Returns:
reference to this object
static CL_Quaternionx<float > CL_Quaternionx< float >::lerp ( const CL_Quaternionx< float > &  quaternion_initial,
const CL_Quaternionx< float > &  quaternion_final,
float  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
float CL_Quaternionx< float >::magnitude (  )  const [inherited]

Get the quaternion magnitude.

CL_Quaternionx<float >& CL_Quaternionx< float >::multiply ( const CL_Quaternionx< float > &  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<float > CL_Quaternionx< float >::multiply ( const CL_Quaternionx< float > &  quaternion_1,
const CL_Quaternionx< float > &  quaternion_2 
) [static, inherited]
CL_Quaternionx<float >& CL_Quaternionx< float >::multiply ( const CL_Mat4< float > &  matrix  )  [inherited]

Multiply this quaternion by a specified matrix.

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

Normalizes this quaternion.

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

Multiplication operator.

References CL_Quaternionx< Type >::multiply().

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

Rotates vector by this quaternion.

Parameters:
v = Vertex to rotate
Returns:
rotated vector
void CL_Quaternionx< float >::set ( const CL_Vec3< float > &  euler,
CL_AngleUnit  unit,
CL_EulerOrder  order 
) [inherited]
void CL_Quaternionx< float >::set ( float  euler_x,
float  euler_y,
float  euler_z,
CL_AngleUnit  unit,
CL_EulerOrder  order 
) [inherited]
void CL_Quaternionx< float >::set ( const CL_Angle euler_x,
const CL_Angle euler_y,
const CL_Angle euler_z,
CL_EulerOrder  order 
) [inherited]
static CL_Quaternionx<float > CL_Quaternionx< float >::slerp ( const CL_Quaternionx< float > &  quaternion_initial,
const CL_Quaternionx< float > &  quaternion_final,
float  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<float > CL_Quaternionx< float >::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]
float CL_Quaternionx< float >::i [inherited]
float CL_Quaternionx< float >::j [inherited]
float CL_Quaternionx< float >::k [inherited]
float CL_Quaternionx< float >::w [inherited]

The real scalar part.

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

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