Public Member Functions | Static Public Member Functions
rtc::Quaternion< T > Class Template Reference

#include <rtcQuaternion.h>

Inheritance diagram for rtc::Quaternion< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

angle () const
 Accessors.
angle (const Quaternion< T > &q) const
Vec< T, 3 > axis () const
void conjugate ()
Quaternion< T > conjugated () const
SMat3< T > drot_dqj (const int j) const
 Quaternion derivatives and matrices.
void invert ()
Quaternion< T > inverted () const
Quaternion< T > operator* (const Quaternion< T > &q) const
 Quaternion operations.
void operator*= (const Quaternion< T > &q)
 Quaternion ()
 Constructor.
 Quaternion (const T w, const T x, const T y, const T z)
 Quaternion (const Vec< T, 4 > &v)
 Quaternion (const Vec< T, 3 > &n, const T theta)
 Quaternion (const EulerAngles< T > &e)
 Quaternion (const Rotation< T > &r)
SMat4< T > quatMat ()
SMat4< T > quatMatBar ()
SMat4< T > quatMatBarT ()
SMat4< T > quatMatT ()
void rotate (Vec< T, 3 > &v) const
 Quaternion rotations.
Vec< T, 3 > rotated (const Vec< T, 3 > &v) const
void set (const Vec< T, 3 > &n, const T theta)
 Mutators.
void set (const EulerAngles< T > &e)
void set (const Rotation< T > &r)
Quaternion< T > slerp (const Quaternion< T > &q, const T &t) const
 Return the quaternion which is the result of Spherical Linear Interpolation between this and the other quaternion.
w () const

Static Public Member Functions

static SMat3< T > d2rot_dqkdqj (int k, int j)
static SMat4< T > dquatMat_dqj (const int j)

Detailed Description

template<class T>
class rtc::Quaternion< T >

The Quaternion Class

Defines quaternion class that derives from Vec<T,3> and knows how to construct itself from several other common rotation representations, such as rotation matrices, axis angles, and euler angles.

Definition at line 53 of file rtcQuaternion.h.


Constructor & Destructor Documentation

template<class T >
rtc::Quaternion< T >::Quaternion ( ) [inline]

Constructor.

Ctor that intializes to a zero-rotation unit quaternion.

Definition at line 118 of file rtcQuaternion.h.

template<class T >
rtc::Quaternion< T >::Quaternion ( const T  w,
const T  _x,
const T  y,
const T  z 
) [inline]

Ctor that initializes vector entries directly.

Definition at line 125 of file rtcQuaternion.h.

template<class T >
rtc::Quaternion< T >::Quaternion ( const Vec< T, 4 > &  v) [inline]

Ctor that initializes from a Vec<T,4>.

Definition at line 132 of file rtcQuaternion.h.

template<class T >
rtc::Quaternion< T >::Quaternion ( const Vec< T, 3 > &  n,
const T  theta 
) [inline]

Ctor that builds a unit quaternion from an axis and an angle of rotation.

Parameters:
nthe axis of rotation
thetathe angle of rotation

Definition at line 139 of file rtcQuaternion.h.

template<class T >
rtc::Quaternion< T >::Quaternion ( const EulerAngles< T > &  e) [inline]

Ctor that builds a unit quaternion from a set of EulerAngles.

Parameters:
eis a set of EulerAngles

Definition at line 147 of file rtcQuaternion.h.

template<class T >
rtc::Quaternion< T >::Quaternion ( const Rotation< T > &  r) [inline]

Ctor that builds a unit quaternion from a rotation matrix. Precondition: r must have unit norm for the quaternion to have unit length

Parameters:
ris a rotation matrix

Definition at line 156 of file rtcQuaternion.h.


Member Function Documentation

template<class T >
T rtc::Quaternion< T >::angle ( ) const [inline]

Accessors.

Get the angle of rotation.

Definition at line 261 of file rtcQuaternion.h.

template<class T >
T rtc::Quaternion< T >::angle ( const Quaternion< T > &  q) const [inline]

Angle between this quaternion and the other

Definition at line 334 of file rtcQuaternion.h.

template<class T >
Vec< T, 3 > rtc::Quaternion< T >::axis ( ) const [inline]

Gets the axis of rotation.

Definition at line 268 of file rtcQuaternion.h.

template<class T >
void rtc::Quaternion< T >::conjugate ( ) [inline]

Quaternion conjugate. conjugates this quaternion

Definition at line 309 of file rtcQuaternion.h.

template<class T >
Quaternion< T > rtc::Quaternion< T >::conjugated ( ) const [inline]

Quaternion conjugate. returns the conjuate quaternion

Definition at line 301 of file rtcQuaternion.h.

template<class T >
SMat3< T > rtc::Quaternion< T >::d2rot_dqkdqj ( int  k,
int  j 
) [inline, static]

Compute the rotation matrix second derivative. returns the second derivative, dR(q) / dq_j dq_k

Definition at line 376 of file rtcQuaternion.h.

template<class T >
SMat4< T > rtc::Quaternion< T >::dquatMat_dqj ( const int  j) [inline, static]

Returns the derivate: dQ(q) / dq_j.

Definition at line 439 of file rtcQuaternion.h.

template<class T >
SMat3< T > rtc::Quaternion< T >::drot_dqj ( const int  j) const [inline]

Quaternion derivatives and matrices.

Compute the rotation matrix derivative. returns the derivative: dR(q) dq_j

Definition at line 354 of file rtcQuaternion.h.

template<class T >
void rtc::Quaternion< T >::invert ( ) [inline]

Quaternion inverse. inverts this quaternion

Definition at line 326 of file rtcQuaternion.h.

template<class T >
Quaternion< T > rtc::Quaternion< T >::inverted ( ) const [inline]

Quaternion inverse. returns the inverse quaternion

Definition at line 317 of file rtcQuaternion.h.

template<class T >
Quaternion< T > rtc::Quaternion< T >::operator* ( const Quaternion< T > &  q) const [inline]

Quaternion operations.

Quaternion multiplication.

Definition at line 279 of file rtcQuaternion.h.

template<class T >
void rtc::Quaternion< T >::operator*= ( const Quaternion< T > &  q) [inline]

Quaternion multiplication assignment operator.

Definition at line 290 of file rtcQuaternion.h.

template<class T >
SMat4< T > rtc::Quaternion< T >::quatMat ( ) [inline]

Return the quaternion matrix. returns the matrix such that q1*q2 = q1.quatMat()*q2

Definition at line 399 of file rtcQuaternion.h.

template<class T >
SMat4< T > rtc::Quaternion< T >::quatMatBar ( ) [inline]

Returns the conjugate quaternion matrix.

Definition at line 419 of file rtcQuaternion.h.

template<class T >
SMat4< T > rtc::Quaternion< T >::quatMatBarT ( ) [inline]

Returns the transpose of the conjugate quaternion matrix.

Definition at line 429 of file rtcQuaternion.h.

template<class T >
SMat4< T > rtc::Quaternion< T >::quatMatT ( ) [inline]

Returns the transpose of the quaternion matrix.

Definition at line 409 of file rtcQuaternion.h.

template<class T >
void rtc::Quaternion< T >::rotate ( Vec< T, 3 > &  v) const [inline]

Quaternion rotations.

Rotates the given vector.

Definition at line 452 of file rtcQuaternion.h.

template<class T >
Vec< T, 3 > rtc::Quaternion< T >::rotated ( const Vec< T, 3 > &  v) const [inline]

Returns a rotated version of the passed vector.

Definition at line 464 of file rtcQuaternion.h.

template<class T >
void rtc::Quaternion< T >::set ( const Vec< T, 3 > &  n,
const T  theta 
) [inline]

Mutators.

Set the quaternion according to the passed axis and angle.

Parameters:
nthe axis of rotation
thetathe angle of rotation

Definition at line 167 of file rtcQuaternion.h.

template<class T >
void rtc::Quaternion< T >::set ( const EulerAngles< T > &  e) [inline]

Set the quaternion according to the passed EulerAngles.

Parameters:
eis a set of EulerAngles

Definition at line 178 of file rtcQuaternion.h.

template<class T >
void rtc::Quaternion< T >::set ( const Rotation< T > &  r) [inline]

Set the quaternion according to the passed axis and angle. Precondition: r must have unit norm for the quaternion to have unit length

Parameters:
ris a rotation matrix

Definition at line 193 of file rtcQuaternion.h.

template<class T >
Quaternion< T > rtc::Quaternion< T >::slerp ( const Quaternion< T > &  q,
const T &  t 
) const

Return the quaternion which is the result of Spherical Linear Interpolation between this and the other quaternion.

Parameters:
qThe other quaternion to interpolate with
tThe ratio between this and q to interpolate. If t = 0 the result is this, if t=1 the result is q. Slerp interpolates assuming constant velocity.

Definition at line 223 of file rtcQuaternion.h.

template<class T >
T rtc::Quaternion< T >::w ( ) const [inline]

Get the angle of rotation.

Definition at line 254 of file rtcQuaternion.h.


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


rtc
Author(s): Benjamin Pitzer
autogenerated on Mon Oct 6 2014 10:07:35