HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_DualQuaternionT< T > Class Template Reference

#include <UT_DualQuaternion.h>

Public Member Functions

SYS_FORCE_INLINE UT_DualQuaternionT ()=default
 Trivial constructor. If called, it initializes to all zeroes. More...
 
 UT_DualQuaternionT (const UT_QuaternionT< T > &real, const UT_QuaternionT< T > &dual)
 Construct from orthogonal real and dual parts. More...
 
 UT_DualQuaternionT (T real_qx, T real_qy, T real_qz, T real_qw, T dual_qx, T dual_qy, T dual_qz, T dual_qw)
 Construct from components of orthogonal real and dual parts. More...
 
 UT_DualQuaternionT (const UT_QuaternionT< T > &r, const UT_Vector3T< T > &t)
 Construct from rotation unit quaternion and translation vector. More...
 
 UT_DualQuaternionT (const UT_Matrix4T< T > &xform)
 Construct from a transform matrix. More...
 
SYS_FORCE_INLINE UT_DualQuaternionT (const UT_DualQuaternionT &dq)=default
 Default copy constructor. More...
 
SYS_FORCE_INLINE
UT_DualQuaternionT< T > & 
operator= (const UT_DualQuaternionT &v)=default
 Default assignment. More...
 
void updateFromXform (const UT_Matrix4T< T > &xform)
 Assign from UT_Matrix4. More...
 
void updateFromXform (const UT_Matrix3T< T > &xform)
 Assign from UT_Matrix3. More...
 
void updateFromRotTransPair (const UT_QuaternionT< T > &r, const UT_Vector3T< T > &t)
 
void updateFromRotTransPair (const UT_QuaternionT< T > &r, T tx, T ty, T tz)
 
T length2 () const
 Methods. More...
 
T length () const
 Length. More...
 
void normalize ()
 Normalizes the dual quaternion to have length of 1. More...
 
void conjugate ()
 Changes dual quaternion into its conjugate. More...
 
void invert ()
 Invert this dual quaternion. Does not exist if getReal() is zero. More...
 
void invertNormalized ()
 
void identity ()
 Change dual quaternion into an 0 rotation and 0 translation components. More...
 
void transform (const UT_Vector3T< T > &vec, UT_Vector3T< T > &dst) const
 Method implementations. More...
 
void rotate (const UT_Vector3T< T > &vec, UT_Vector3T< T > &dst) const
 
UT_Matrix4T< TconvertToXform () const
 
UT_DualQuaternionT< T > & operator*= (T scalar)
 Operators. More...
 
UT_DualQuaternionT< T > & operator*= (const UT_DualQuaternionT< T > &dq)
 
UT_DualQuaternionT< T > & operator+= (const UT_DualQuaternionT< T > &dq)
 Operator implementations. More...
 
UT_DualQuaternionT< T > & operator-= (const UT_DualQuaternionT< T > &dq)
 
bool operator== (const UT_DualQuaternionT< T > &dq) const
 
bool operator!= (const UT_DualQuaternionT< T > &dq) const
 
bool isEqual (const UT_DualQuaternionT< T > &quat, T tol=T(SYS_FTOLERANCE)) const
 Like operator==() but using a tolerance. More...
 
const TrealData () const
 Getters. More...
 
TrealData ()
 
const TdualData () const
 
TdualData ()
 
const UT_QuaternionT< T > & getReal () const
 
const UT_QuaternionT< T > & getDual () const
 
const UT_QuaternionT< T > & getTranslation () const
 
const UT_QuaternionT< T > & getRotation () const
 

Protected Member Functions

UT_API void outTo (std::ostream &os) const
 
template<>
UT_API void outTo (std::ostream &os) const
 
template<>
UT_API void outTo (std::ostream &os) const
 

Friends

std::ostream & operator<< (std::ostream &os, const UT_DualQuaternionT< T > &dq)
 

Detailed Description

template<typename T>
class UT_DualQuaternionT< T >

Dual quaternion class

Note
This class only supports the subspace of dual quaternions for use as rigid transforms. As such, its real and dual components must be orthogonal.

Definition at line 39 of file UT_DualQuaternion.h.

Constructor & Destructor Documentation

template<typename T>
SYS_FORCE_INLINE UT_DualQuaternionT< T >::UT_DualQuaternionT ( )
default

Trivial constructor. If called, it initializes to all zeroes.

template<typename T >
UT_DualQuaternionT< T >::UT_DualQuaternionT ( const UT_QuaternionT< T > &  real,
const UT_QuaternionT< T > &  dual 
)
inline

Construct from orthogonal real and dual parts.

Construct implementations.

Definition at line 195 of file UT_DualQuaternion.h.

template<typename T >
UT_DualQuaternionT< T >::UT_DualQuaternionT ( T  real_qx,
T  real_qy,
T  real_qz,
T  real_qw,
T  dual_qx,
T  dual_qy,
T  dual_qz,
T  dual_qw 
)
inline

Construct from components of orthogonal real and dual parts.

Definition at line 204 of file UT_DualQuaternion.h.

template<typename T >
UT_DualQuaternionT< T >::UT_DualQuaternionT ( const UT_QuaternionT< T > &  r,
const UT_Vector3T< T > &  t 
)
inline

Construct from rotation unit quaternion and translation vector.

Definition at line 214 of file UT_DualQuaternion.h.

template<typename T >
UT_DualQuaternionT< T >::UT_DualQuaternionT ( const UT_Matrix4T< T > &  xform)
inline

Construct from a transform matrix.

Definition at line 223 of file UT_DualQuaternion.h.

template<typename T>
SYS_FORCE_INLINE UT_DualQuaternionT< T >::UT_DualQuaternionT ( const UT_DualQuaternionT< T > &  dq)
default

Default copy constructor.

Member Function Documentation

template<typename T >
void UT_DualQuaternionT< T >::conjugate ( )
inline

Changes dual quaternion into its conjugate.

Definition at line 368 of file UT_DualQuaternion.h.

template<typename T >
UT_Matrix4T< T > UT_DualQuaternionT< T >::convertToXform ( ) const
inline

Returns a xform that is represented by the dual quaternion Requires this is normalized

Definition at line 303 of file UT_DualQuaternion.h.

template<typename T>
const T* UT_DualQuaternionT< T >::dualData ( ) const
inline

Definition at line 152 of file UT_DualQuaternion.h.

template<typename T>
T* UT_DualQuaternionT< T >::dualData ( )
inline

Definition at line 153 of file UT_DualQuaternion.h.

template<typename T>
const UT_QuaternionT<T>& UT_DualQuaternionT< T >::getDual ( ) const
inline

Definition at line 156 of file UT_DualQuaternion.h.

template<typename T>
const UT_QuaternionT<T>& UT_DualQuaternionT< T >::getReal ( ) const
inline

Definition at line 155 of file UT_DualQuaternion.h.

template<typename T>
const UT_QuaternionT<T>& UT_DualQuaternionT< T >::getRotation ( ) const
inline

Definition at line 158 of file UT_DualQuaternion.h.

template<typename T>
const UT_QuaternionT<T>& UT_DualQuaternionT< T >::getTranslation ( ) const
inline

Definition at line 157 of file UT_DualQuaternion.h.

template<typename T >
void UT_DualQuaternionT< T >::identity ( )
inline

Change dual quaternion into an 0 rotation and 0 translation components.

Definition at line 396 of file UT_DualQuaternion.h.

template<typename T >
void UT_DualQuaternionT< T >::invert ( )
inline

Invert this dual quaternion. Does not exist if getReal() is zero.

Definition at line 376 of file UT_DualQuaternion.h.

template<typename T >
void UT_DualQuaternionT< T >::invertNormalized ( )
inline

Invert this dual quaternion, assuming that its already normalized. Does not exist if getReal() is zero.

Definition at line 386 of file UT_DualQuaternion.h.

template<typename T >
bool UT_DualQuaternionT< T >::isEqual ( const UT_DualQuaternionT< T > &  quat,
T  tol = T(SYS_FTOLERANCE) 
) const
inline

Like operator==() but using a tolerance.

Definition at line 453 of file UT_DualQuaternion.h.

template<typename T >
T UT_DualQuaternionT< T >::length ( void  ) const
inline

Length.

Definition at line 339 of file UT_DualQuaternion.h.

template<typename T >
T UT_DualQuaternionT< T >::length2 ( ) const
inline

Methods.

Length squared

Definition at line 331 of file UT_DualQuaternion.h.

template<typename T >
void UT_DualQuaternionT< T >::normalize ( )
inline

Normalizes the dual quaternion to have length of 1.

Definition at line 346 of file UT_DualQuaternion.h.

template<typename T >
bool UT_DualQuaternionT< T >::operator!= ( const UT_DualQuaternionT< T > &  dq) const
inline

Definition at line 467 of file UT_DualQuaternion.h.

template<typename T >
UT_DualQuaternionT< T > & UT_DualQuaternionT< T >::operator*= ( T  scalar)
inline

Operators.

Definition at line 418 of file UT_DualQuaternion.h.

template<typename T >
UT_DualQuaternionT< T > & UT_DualQuaternionT< T >::operator*= ( const UT_DualQuaternionT< T > &  dq)
inline

Definition at line 427 of file UT_DualQuaternion.h.

template<typename T >
UT_DualQuaternionT< T > & UT_DualQuaternionT< T >::operator+= ( const UT_DualQuaternionT< T > &  dq)
inline

Operator implementations.

Definition at line 409 of file UT_DualQuaternion.h.

template<typename T >
UT_DualQuaternionT< T > & UT_DualQuaternionT< T >::operator-= ( const UT_DualQuaternionT< T > &  dq)
inline

Definition at line 436 of file UT_DualQuaternion.h.

template<typename T>
SYS_FORCE_INLINE UT_DualQuaternionT<T>& UT_DualQuaternionT< T >::operator= ( const UT_DualQuaternionT< T > &  v)
default

Default assignment.

template<typename T >
bool UT_DualQuaternionT< T >::operator== ( const UT_DualQuaternionT< T > &  dq) const
inline

Definition at line 445 of file UT_DualQuaternion.h.

template<typename T>
UT_API void UT_DualQuaternionT< T >::outTo ( std::ostream &  os) const
protected
template<>
UT_API void UT_DualQuaternionT< fpreal32 >::outTo ( std::ostream &  os) const
protected
template<>
UT_API void UT_DualQuaternionT< fpreal64 >::outTo ( std::ostream &  os) const
protected
template<typename T>
const T* UT_DualQuaternionT< T >::realData ( ) const
inline

Getters.

Definition at line 149 of file UT_DualQuaternion.h.

template<typename T>
T* UT_DualQuaternionT< T >::realData ( )
inline

Definition at line 150 of file UT_DualQuaternion.h.

template<typename T >
void UT_DualQuaternionT< T >::rotate ( const UT_Vector3T< T > &  vec,
UT_Vector3T< T > &  dst 
) const
inline

Returns a vector that has only the rotation component applied Requires this is normalized

Definition at line 293 of file UT_DualQuaternion.h.

template<typename T >
void UT_DualQuaternionT< T >::transform ( const UT_Vector3T< T > &  vec,
UT_Vector3T< T > &  dst 
) const
inline

Method implementations.

Returns a vector that is transformed by the dual quaternion Requires this is normalized

Definition at line 273 of file UT_DualQuaternion.h.

template<typename T >
void UT_DualQuaternionT< T >::updateFromRotTransPair ( const UT_QuaternionT< T > &  r,
const UT_Vector3T< T > &  t 
)
inline

Definition at line 323 of file UT_DualQuaternion.h.

template<typename T >
void UT_DualQuaternionT< T >::updateFromRotTransPair ( const UT_QuaternionT< T > &  r,
T  tx,
T  ty,
T  tz 
)
inline

Definition at line 252 of file UT_DualQuaternion.h.

template<typename T >
void UT_DualQuaternionT< T >::updateFromXform ( const UT_Matrix4T< T > &  xform)
inline

Assign from UT_Matrix4.

Definition at line 230 of file UT_DualQuaternion.h.

template<typename T >
void UT_DualQuaternionT< T >::updateFromXform ( const UT_Matrix3T< T > &  xform)
inline

Assign from UT_Matrix3.

Definition at line 244 of file UT_DualQuaternion.h.

Friends And Related Function Documentation

template<typename T>
std::ostream& operator<< ( std::ostream &  os,
const UT_DualQuaternionT< T > &  dq 
)
friend

Definition at line 139 of file UT_DualQuaternion.h.


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