CMSC23700 Common Code Library
Support code for CS23700 programming projects
cs237::__detail::quat< T > Struct Template Reference

template class for quaternions More...

#include <cs237-quat.hxx>

Public Member Functions

 quat ()
 
 quat (quat const &q)
 
 quat (T xx, T yy, T zz)
 
 quat (T xx, T yy, T zz, T ww)
 
 quat (vec3< T > const &v)
 
 quat (vec3< T > const &v, T ww)
 
 quat (T angle, vec3< T > const &axis)
 create a quaternion from an angle (in degrees) and an axis vector More...
 
T & operator[] (unsigned int const &i)
 
T const & operator[] (unsigned int const &i) const
 
quatoperator= (quat const &v)
 
quatoperator+= (quat const &v)
 
quatoperator-= (quat const &v)
 
quatoperator*= (T const &s)
 
quatoperator*= (quat const &q)
 
quatoperator*= (vec3< T > const &v)
 
quatoperator/= (T const &s)
 
quat conjugate () const
 
quat inverse () const
 
length () const
 
quatnormalize ()
 normalize this quaternion to unit length More...
 
vec3< T > rotate (vec3< T > const &v) const
 
mat3x3< T > toMat3x3 () const
 return the 3x3 linear rotation matrix represented by this quaternion More...
 
mat4x4< T > toMat4x4 () const
 return the 3x3 affine rotation matrix represented by this quaternion More...
 

Public Attributes

x
 
y
 
z
 
w
 

Detailed Description

template<typename T>
struct cs237::__detail::quat< T >

template class for quaternions

Constructor & Destructor Documentation

template<typename T >
cs237::__detail::quat< T >::quat ( )
inline
template<typename T >
cs237::__detail::quat< T >::quat ( quat< T > const &  q)
inline
template<typename T >
cs237::__detail::quat< T >::quat ( xx,
yy,
zz 
)
inlineexplicit
template<typename T >
cs237::__detail::quat< T >::quat ( xx,
yy,
zz,
ww 
)
inlineexplicit
template<typename T >
cs237::__detail::quat< T >::quat ( vec3< T > const &  v)
inlineexplicit
template<typename T >
cs237::__detail::quat< T >::quat ( vec3< T > const &  v,
ww 
)
inlineexplicit
template<typename T >
cs237::__detail::quat< T >::quat ( angle,
vec3< T > const &  axis 
)
inlineexplicit

create a quaternion from an angle (in degrees) and an axis vector

Member Function Documentation

template<typename T >
quat< T > cs237::__detail::quat< T >::conjugate ( ) const
inline
template<typename T >
quat< T > cs237::__detail::quat< T >::inverse ( ) const
inline
template<typename T >
T cs237::__detail::quat< T >::length ( ) const
inline
template<typename T >
quat< T > & cs237::__detail::quat< T >::normalize ( )
inline

normalize this quaternion to unit length

template<typename T >
quat< T > & cs237::__detail::quat< T >::operator*= ( T const &  s)
inline
template<typename T >
quat< T > & cs237::__detail::quat< T >::operator*= ( quat< T > const &  q)
inline
template<typename T >
quat< T > & cs237::__detail::quat< T >::operator*= ( vec3< T > const &  v)
inline
template<typename T >
quat< T > & cs237::__detail::quat< T >::operator+= ( quat< T > const &  v)
inline
template<typename T >
quat< T > & cs237::__detail::quat< T >::operator-= ( quat< T > const &  v)
inline
template<typename T >
quat< T > & cs237::__detail::quat< T >::operator/= ( T const &  s)
inline
template<typename T >
quat< T > & cs237::__detail::quat< T >::operator= ( quat< T > const &  v)
inline
template<typename T >
T & cs237::__detail::quat< T >::operator[] ( unsigned int const &  i)
inline
template<typename T >
T const & cs237::__detail::quat< T >::operator[] ( unsigned int const &  i) const
template<typename T >
vec3< T > cs237::__detail::quat< T >::rotate ( vec3< T > const &  v) const
inline

apply the rotation represented by this quaternion to a vector; this operation is equivalent to (*this) * v * this->inverse().

template<typename T >
mat3x3<T> cs237::__detail::quat< T >::toMat3x3 ( ) const

return the 3x3 linear rotation matrix represented by this quaternion

template<typename T >
mat4x4<T> cs237::__detail::quat< T >::toMat4x4 ( ) const

return the 3x3 affine rotation matrix represented by this quaternion

Member Data Documentation

template<typename T >
T cs237::__detail::quat< T >::w
template<typename T >
T cs237::__detail::quat< T >::x
template<typename T >
T cs237::__detail::quat< T >::y
template<typename T >
T cs237::__detail::quat< T >::z

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