cgv
|
implementation of a rigid body transformation with a quaternion and a translation vector. More...
#include <rigid_transform.h>
Public Types | |
typedef cgv::math::fvec< T, 3 > | vec_type |
type of 3d vector | |
typedef cgv::math::fvec< T, 4 > | hvec_type |
type of homogenous vector | |
typedef cgv::math::quaternion< T > | quat_type |
type of quaternions | |
typedef cgv::math::fmat< T, 3, 3 > | mat_type |
type of 3x3 matrix | |
typedef cgv::math::fmat< T, 4, 4 > | hmat_type |
type of 4x4 matrix | |
Public Member Functions | |
rigid_transform () | |
construct identity | |
rigid_transform (const quat_type &_q, const vec_type &_t) | |
construct from quaternion and translation vector to the transformation that first rotates and then translates | |
void | transform_vector (vec_type &v) const |
apply transformation to vector | |
void | transform_point (vec_type &p) const |
apply transformation to point | |
rigid_transform< T > | operator* (const rigid_transform< T > &M) const |
concatenate two rigid transformations | |
rigid_transform< T > & | operator+= (const rigid_transform< T > &T) |
multiply quaternion and translation with scalar | |
rigid_transform< T > & | operator*= (T s) |
multiply quaternion and translation with scalar | |
rigid_transform< T > | operator* (T s) const |
multiply quaternion and translation with scalar | |
void | normalize () |
rigid_transform< T > | inverse () const |
return the inverse transformation | |
vec_type | get_transformed_vector (const vec_type &v) const |
apply transformation to vector | |
vec_type | get_transformed_point (const vec_type &p) const |
apply transformation to point | |
const vec_type & | get_translation () const |
return the translational part | |
vec_type & | ref_translation () |
return the translational part | |
const quat_type & | get_quaternion () const |
return the rotation as quaternion | |
quat_type & | ref_quaternion () |
return the rotation as quaternion | |
hmat_type | get_hmat () const |
convert transformation to homogeneous transformation | |
hmat_type | get_transposed_hmat () const |
convert transformation to transpose of homogeneous transformation | |
Protected Attributes | |
quat_type | q |
store transformation as quaternion | |
vec_type | t |
and translation vector | |
implementation of a rigid body transformation with a quaternion and a translation vector.
Definition at line 13 of file rigid_transform.h.
typedef cgv::math::fmat<T,4,4> cgv::math::rigid_transform< T >::hmat_type |
type of 4x4 matrix
Definition at line 25 of file rigid_transform.h.
typedef cgv::math::fvec<T,4> cgv::math::rigid_transform< T >::hvec_type |
type of homogenous vector
Definition at line 19 of file rigid_transform.h.
typedef cgv::math::fmat<T,3,3> cgv::math::rigid_transform< T >::mat_type |
type of 3x3 matrix
Definition at line 23 of file rigid_transform.h.
typedef cgv::math::quaternion<T> cgv::math::rigid_transform< T >::quat_type |
type of quaternions
Definition at line 21 of file rigid_transform.h.
typedef cgv::math::fvec<T,3> cgv::math::rigid_transform< T >::vec_type |
type of 3d vector
Definition at line 17 of file rigid_transform.h.
|
inline |
construct identity
Definition at line 33 of file rigid_transform.h.
|
inline |
construct from quaternion and translation vector to the transformation that first rotates and then translates
Definition at line 35 of file rigid_transform.h.
|
inline |
convert transformation to homogeneous transformation
Definition at line 65 of file rigid_transform.h.
References cgv::math::quaternion< T >::put_matrix(), cgv::math::rigid_transform< T >::q, cgv::math::fmat< T, N, M >::set_col(), and cgv::math::rigid_transform< T >::t.
|
inline |
return the rotation as quaternion
Definition at line 61 of file rigid_transform.h.
References cgv::math::rigid_transform< T >::q.
|
inline |
apply transformation to point
Definition at line 55 of file rigid_transform.h.
References cgv::math::quaternion< T >::apply(), cgv::math::rigid_transform< T >::q, and cgv::math::rigid_transform< T >::t.
|
inline |
apply transformation to vector
Definition at line 53 of file rigid_transform.h.
References cgv::math::quaternion< T >::apply(), and cgv::math::rigid_transform< T >::q.
Referenced by cgv::math::rigid_transform< T >::operator*().
|
inline |
return the translational part
Definition at line 57 of file rigid_transform.h.
References cgv::math::rigid_transform< T >::t.
|
inline |
convert transformation to transpose of homogeneous transformation
Definition at line 76 of file rigid_transform.h.
References cgv::math::quaternion< T >::put_matrix(), cgv::math::rigid_transform< T >::q, cgv::math::fmat< T, N, M >::set_row(), and cgv::math::rigid_transform< T >::t.
|
inline |
return the inverse transformation
Definition at line 51 of file rigid_transform.h.
References cgv::math::quaternion< T >::inverse(), cgv::math::rigid_transform< T >::q, and cgv::math::rigid_transform< T >::t.
|
inline |
Definition at line 49 of file rigid_transform.h.
|
inline |
concatenate two rigid transformations
Definition at line 41 of file rigid_transform.h.
References cgv::math::rigid_transform< T >::get_transformed_vector(), cgv::math::rigid_transform< T >::q, and cgv::math::rigid_transform< T >::t.
|
inline |
multiply quaternion and translation with scalar
Definition at line 47 of file rigid_transform.h.
|
inline |
multiply quaternion and translation with scalar
Definition at line 45 of file rigid_transform.h.
References cgv::math::rigid_transform< T >::q, and cgv::math::rigid_transform< T >::t.
|
inline |
multiply quaternion and translation with scalar
Definition at line 43 of file rigid_transform.h.
References cgv::math::rigid_transform< T >::q, and cgv::math::rigid_transform< T >::t.
|
inline |
return the rotation as quaternion
Definition at line 63 of file rigid_transform.h.
References cgv::math::rigid_transform< T >::q.
|
inline |
return the translational part
Definition at line 59 of file rigid_transform.h.
References cgv::math::rigid_transform< T >::t.
|
inline |
apply transformation to point
Definition at line 39 of file rigid_transform.h.
References cgv::math::rigid_transform< T >::q, cgv::math::quaternion< T >::rotate(), and cgv::math::rigid_transform< T >::t.
|
inline |
apply transformation to vector
Definition at line 37 of file rigid_transform.h.
References cgv::math::rigid_transform< T >::q, and cgv::math::quaternion< T >::rotate().
|
protected |
store transformation as quaternion
Definition at line 28 of file rigid_transform.h.
Referenced by cgv::math::rigid_transform< T >::get_hmat(), cgv::math::rigid_transform< T >::get_quaternion(), cgv::math::rigid_transform< T >::get_transformed_point(), cgv::math::rigid_transform< T >::get_transformed_vector(), cgv::math::rigid_transform< T >::get_transposed_hmat(), cgv::math::rigid_transform< T >::inverse(), cgv::math::rigid_transform< T >::operator*(), cgv::math::rigid_transform< T >::operator*=(), cgv::math::rigid_transform< T >::operator+=(), cgv::math::rigid_transform< T >::ref_quaternion(), cgv::math::rigid_transform< T >::transform_point(), and cgv::math::rigid_transform< T >::transform_vector().
|
protected |
and translation vector
Definition at line 30 of file rigid_transform.h.
Referenced by cgv::math::rigid_transform< T >::get_hmat(), cgv::math::rigid_transform< T >::get_transformed_point(), cgv::math::rigid_transform< T >::get_translation(), cgv::math::rigid_transform< T >::get_transposed_hmat(), cgv::math::rigid_transform< T >::inverse(), cgv::math::rigid_transform< T >::operator*(), cgv::math::rigid_transform< T >::operator*=(), cgv::math::rigid_transform< T >::operator+=(), cgv::math::rigid_transform< T >::ref_translation(), and cgv::math::rigid_transform< T >::transform_point().