ork::quat< type > Class Template Reference
[math]

A templated quaternion class. More...

#include <quat.h>

List of all members.

Public Member Functions

 quat ()
 Creates a new, uninitialized quaternion.
 quat (type x, type y, type z, type w)
 Creates a new quaternion with the given coordinates (useless in general outside this header).
 quat (const type v[4])
 Creates a new quaternion with the given coordinates.
 quat (const quat &v)
 Creates a new quaternion as a copy of the given quaternion.
 quat (const vec3< type > &axis, type angle)
 Create a normalized quaternion from an axis and an angle (MOST USEFUL).
 quat (const vec3< type > &to, const vec3< type > &from)
 Create a normalized quaternion which transform a vector into another.
quat operator* (const quat &a) const
 Multiply by another quaternion (replace a 3x3 rotation matrix multiplication).
vec3< type > operator* (const vec3< type > &a) const
 Multiply directly by a vector.
quatoperator*= (const quat &a)
 Multiply by another quaternion (replace a 3x3 rotation matrix multiplication).
quat inverse () const
 Returns the inverse of this quaternion.
type length () const
 If length is 1, this is a normalized quaternion (the interesting ones).
quat normalize () const
 Returns this quaternion normalized to unit length.
mat3< type > toMat3 () const
 Returns the correponding 3x3 rotation matrix.
mat4< type > toMat4 () const
 Returns the correponding 4x4 rotation matrix.

Public Attributes

type x
 x coordinate.
type y
 y coordinate.
type z
 z coordinate.
type w
 w coordinate.

Detailed Description

template<typename type>
class ork::quat< type >

A templated quaternion class.

Important : assumes T is typeing point type.


Constructor & Destructor Documentation

template<typename type >
ork::quat< type >::quat (  )  [inline]

Creates a new, uninitialized quaternion.

template<typename type >
ork::quat< type >::quat ( type  x,
type  y,
type  z,
type  w 
) [inline]

Creates a new quaternion with the given coordinates (useless in general outside this header).

template<typename type >
ork::quat< type >::quat ( const type  v[4]  )  [inline]

Creates a new quaternion with the given coordinates.

template<typename type >
ork::quat< type >::quat ( const quat< type > &  v  )  [inline]

Creates a new quaternion as a copy of the given quaternion.

template<typename type >
ork::quat< type >::quat ( const vec3< type > &  axis,
type  angle 
) [inline]

Create a normalized quaternion from an axis and an angle (MOST USEFUL).

Parameters:
axis an axis (do not need to be normalized)
angle angle in radian
template<typename type >
ork::quat< type >::quat ( const vec3< type > &  to,
const vec3< type > &  from 
) [inline]

Create a normalized quaternion which transform a vector into another.

No need to pass normalized vectors.


Member Function Documentation

template<typename type >
quat< type > ork::quat< type >::inverse (  )  const [inline]

Returns the inverse of this quaternion.

template<typename type >
type ork::quat< type >::length (  )  const [inline]

If length is 1, this is a normalized quaternion (the interesting ones).

template<typename type >
quat< type > ork::quat< type >::normalize (  )  const [inline]

Returns this quaternion normalized to unit length.

template<typename type >
vec3< type > ork::quat< type >::operator* ( const vec3< type > &  a  )  const [inline]

Multiply directly by a vector.

Returns a rotated vector.

template<typename type >
quat< type > ork::quat< type >::operator* ( const quat< type > &  a  )  const [inline]

Multiply by another quaternion (replace a 3x3 rotation matrix multiplication).

template<typename type >
quat< type > & ork::quat< type >::operator*= ( const quat< type > &  a  )  [inline]

Multiply by another quaternion (replace a 3x3 rotation matrix multiplication).

template<typename type >
mat3< type > ork::quat< type >::toMat3 (  )  const [inline]

Returns the correponding 3x3 rotation matrix.

template<typename type >
mat4< type > ork::quat< type >::toMat4 (  )  const [inline]

Returns the correponding 4x4 rotation matrix.


Member Data Documentation

template<typename type >
type ork::quat< type >::w

w coordinate.

template<typename type >
type ork::quat< type >::x

x coordinate.

template<typename type >
type ork::quat< type >::y

y coordinate.

template<typename type >
type ork::quat< type >::z

z coordinate.


Generated on Mon Oct 18 09:36:08 2010 for ork by  doxygen 1.6.1