ClanLib  2.3.7
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CL_Quaternionf Class Reference

Quaternion - Float. More...

#include <quaternion.h>

Inheritance diagram for CL_Quaternionf:
Inheritance graph
[legend]

Public Member Functions

 CL_Quaternionf ()
 
 CL_Quaternionf (const CL_Quaternionx< float > &copy)
 
 CL_Quaternionf (float real, float i, float j, float k)
 
 CL_Quaternionf (float real, const CL_Vec3< float > &imag)
 
 CL_Quaternionf (float euler_x, float euler_y, float euler_z, CL_AngleUnit unit, CL_EulerOrder order)
 
 CL_Quaternionf (const CL_Vec3< float > &euler, CL_AngleUnit unit, CL_EulerOrder order)
 
 CL_Quaternionf (const CL_Angle &euler_x, const CL_Angle &euler_y, const CL_Angle &euler_z, CL_EulerOrder order)
 
Operations
CL_Quaternionx< float > & multiply (const CL_Mat4< float > &matrix)
 Multiply this quaternion by a specified matrix. More...
 
CL_Quaternionx< float > & multiply (const CL_Quaternionx< float > &quaternion)
 Multiply this quaternion by another quaternion. More...
 
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. More...
 
CL_Quaternionx< float > & inverse ()
 Inverse this quaternion. More...
 
CL_Vec3< float > rotate_vector (const CL_Vec3< float > &v)
 Rotates vector by this quaternion. More...
 
CL_Vec4< float > rotate_vector (const CL_Vec4< float > &v)
 
Attributes
CL_Mat4< float > to_matrix () const
 Convert the quaternion to a rotation matrix. More...
 
float magnitude () const
 Get the quaternion magnitude. More...
 
Operators
CL_Quaternionx< float > operator* (const CL_Quaternionx< float > &mult) const
 Multiplication operator. More...
 

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. More...
 
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. More...
 

Public Attributes

union {
   Type   i
 
   Type   x
 
}; 
 The imaginary vector part. More...
 
union {
   Type   j
 
   Type   y
 
}; 
 
union {
   Type   k
 
   Type   z
 
}; 
 
float i
 
float j
 
float k
 
float w
 The real scalar part. More...
 
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 
)
staticinherited
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 
)
staticinherited

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.

static CL_Quaternionx<float > CL_Quaternionx< float >::multiply ( const CL_Quaternionx< float > &  quaternion_1,
const CL_Quaternionx< float > &  quaternion_2 
)
staticinherited
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 >::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
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
inlineinherited

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_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
CL_Vec4<float > CL_Quaternionx< float >::rotate_vector ( const CL_Vec4< float > &  v)
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_Vec3< float > &  euler,
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 
)
staticinherited

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 { ... }

The imaginary vector part.

union { ... }
union { ... }
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: