ASL
Quaternion_< T > Class Template Reference

Detailed Description

template<class T>
class asl::Quaternion_< T >

A Quaternion representing an orientation or rotation in 3D space.

#include <Quaternion.h>

Public Member Functions

 Quaternion_ (T w, T x, T y, T z)
 Creates a quaternion from its 4 elements.
 
 Quaternion_ (T w, const Vec3_< T > &v)
 Creates a quaternion from a scalar and a vector.
 
angle () const
 Returns the angle rotated by this quaternion.
 
Vec3_< T > axis () const
 Returns the normalized axis of rotation of this quaternion.
 
Vec3_< T > axisAngle () const
 Returns the axis-angle representation of the rotation equivalent to this quaternion (a vector aligned with the rotation axis and with length equal to the rotation angle)
 
Matrix4_< T > matrix () const
 Returns a transform matrix equivalent to the rotation of this quaternion.
 
Quaternion_ operator- () const
 Returns this quaternion negated.
 
Quaternion_ conj () const
 Returns the conjugate of this quaternion.
 
Quaternion_ operator* (T t) const
 Returns this quaternion multiplied by a scalar.
 
Quaternion_ operator/ (T t) const
 Returns this quaternion divided by a scalar.
 
length () const
 Returns the length (norm) of this quaternion.
 
length2 () const
 Returns the length (norm) of this quaternion squared.
 
Quaternion_ inverse () const
 Returns the inverse of this quaternion.
 
Vec3_< T > operator* (const Vec3_< T > &v) const
 Returns the given vector rotated by this quaterion.
 
operator* (const Quaternion_ &q) const
 Returns the dot product of this quaternion and q.
 
Quaternion_ operator^ (const Quaternion_ &q) const
 Returns the product of this quaternion and q, representing the rotation q followed by this rotation.
 
Quaternion_ slerp (const Quaternion_ &q, T t) const
 Returns an interpolated quaternion between this and b at the given interpolation factor t in [0..1].
 

Static Public Member Functions

static Quaternion_ fromAxisAngle (const Vec3_< T > &axis, T angle)
 Creates a quaternion representing a rotation of angle angle around axis axis
 
static Quaternion_ fromAxisAngleU (const Vec3_< T > &axis, T angle)
 Creates a quaternion representing a rotation of angle angle around axis axis of length one
 
static Quaternion_ fromAxisAngle (const Vec3_< T > &v)
 Creates a quaternion from a rotation vector (aligned with the rotation axis and with length equal to the rotation angle)
 

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