cpe::quaternion Class Reference

Quaternion class. More...

Inheritance diagram for cpe::quaternion:
Inheritance graph
[legend]
Collaboration diagram for cpe::quaternion:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 quaternion ()
 default constructor
 quaternion (const v3 &axis, const double &angle)
 constructor from axis and angle
 quaternion (const v4 &entries)
 direct constructor
v3 axis () const
 get the unit axis corresponding to the quaternion
double angle () const
 get the angle corresponding to the quaternion
matrix3 matrix () const
 compute the rotation matrix associated to the current quaternion
quaternion conjugated () const
 get the conjugate of the current quaterion
quaternionoperator*= (const quaternion &q1)
 internal multiplication between quaternion

Static Public Member Functions

static quaternion slerp (const quaternion &q0, const quaternion &q1, const double &t)
 Spherical Linear Interpolation SLERP.

Friends

quaternion operator* (const quaternion &q0, const quaternion &q1)
 multiplication between quaternion
v3 operator* (const quaternion &q, const v3 &v)
 multiplication with a vector

Detailed Description

Quaternion class.


Constructor & Destructor Documentation

cpe::quaternion::quaternion (  ) 

default constructor

Referenced by conjugated().

cpe::quaternion::quaternion ( const v3 axis,
const double &  angle 
)

constructor from axis and angle

References cpe::v3::normalized(), cpe::v4::w(), cpe::v4::x(), cpe::v4::y(), and cpe::v4::z().

Here is the call graph for this function:

cpe::quaternion::quaternion ( const v4 entries  ) 

direct constructor


Member Function Documentation

double cpe::quaternion::angle (  )  const

get the angle corresponding to the quaternion

References cpe::v4::w().

Here is the call graph for this function:

v3 cpe::quaternion::axis (  )  const

get the unit axis corresponding to the quaternion

References cpe::v3::normalized(), cpe::v4::x(), cpe::v4::y(), and cpe::v4::z().

Here is the call graph for this function:

quaternion cpe::quaternion::conjugated (  )  const

get the conjugate of the current quaterion

References quaternion(), cpe::v4::v4(), cpe::v4::w(), cpe::v4::x(), cpe::v4::y(), and cpe::v4::z().

Referenced by cpe::trackball::apply_rotation(), and cpe::navigator_tool::camera_orientation().

Here is the call graph for this function:

matrix3 cpe::quaternion::matrix (  )  const

compute the rotation matrix associated to the current quaternion

Returns:
a 3x3 rotation matrix

References cpe::v4::w(), cpe::v4::x(), cpe::v4::y(), and cpe::v4::z().

Referenced by cpe::navigator_tool::camera_orientation().

Here is the call graph for this function:

quaternion & cpe::quaternion::operator*= ( const quaternion q1  ) 

internal multiplication between quaternion

References cpe::v3::cross(), cpe::v3::dot(), cpe::v4::w(), cpe::v4::x(), cpe::v4::y(), and cpe::v4::z().

Here is the call graph for this function:

quaternion cpe::quaternion::slerp ( const quaternion q0,
const quaternion q1,
const double &  t 
) [static]

Spherical Linear Interpolation SLERP.

Use (sin((1-t) theta )q0 +sin(t theta)q1)/sin(theta) But same results with (q1 q0^{-1})^{t} q0 (q1*q0.invert()).pow_q(t)*q0)

References cpe::v4::dot().

Here is the call graph for this function:


Friends And Related Function Documentation

v3 operator* ( const quaternion q,
const v3 v 
) [friend]

multiplication with a vector

quaternion operator* ( const quaternion q0,
const quaternion q1 
) [friend]

multiplication between quaternion


The documentation for this class was generated from the following files:
Generated on Mon Feb 27 17:40:17 2012 by  doxygen 1.6.3