Thea
Public Types | Public Member Functions | Static Public Member Functions | List of all members
RigidTransformN< 3, T > Class Template Reference

A rigid transformation in 3-space, consisting of a rotation followed by a translation. More...

#include <RigidTransform3.hpp>

Inheritance diagram for RigidTransformN< 3, T >:
RigidTransformNBase< 3, T >

Public Types

typedef RigidTransformN< N, T > RigidTransformT
 N-dimensional rigid transform type. More...
 

Public Member Functions

void _setRotation (MatrixT const &rot)
 Set the rotation matrix (use with caution since it can break the rigidity guarantee). More...
 
RigidTransformN< N, U > cast () const
 Cast the transform to a different scalar type. More...
 
MatrixT const & getRotation () const
 Get rotation component. More...
 
VectorT const & getTranslation () const
 Get translation component. More...
 
Matrix< N+1, N+1, T > homogeneous () const
 Convert to an (N + 1) x (N + 1) transformation matrix in homogeneous coordinates (last row is identity). More...
 
RigidTransformT inverse () const
 Get the inverse transform. More...
 
 operator AffineTransformT () const
 Convert to a general affine transform. More...
 
Real operator() (int i, int j) const
 Get an element of the N x (N + 1) matrix representing this transform. More...
 
RigidTransformT operator* (RigidTransformT const &rhs) const
 Compose this transform with another. More...
 
VectorT operator* (VectorT const &v) const
 Apply this transform to a N-vector. More...
 
 RigidTransformN ()
 Default constructor. More...
 
void setIdentity ()
 Set the transform to identity. More...
 
void setTranslation (VectorT const &translation_)
 Set translation component. More...
 
AffineTransformT const & toAffine () const
 Convert to a general affine transform. More...
 
Matrix< N, N+1, T > toMatrix () const
 Convert to an N x (N + 1) transformation matrix. More...
 
std::string toString () const
 Get a string representing the transform. More...
 

Static Public Member Functions

static RigidTransformT _fromAffine (AffineTransformT const &aff_)
 Construct from an affine transform, assuming it is rigid (use with caution since it can break the rigidity guarantee). More...
 
static RigidTransformT const & identity ()
 Get the identity transform. More...
 
static RigidTransformN rotationArc (VectorT const &start_dir, VectorT const &end_dir, bool normalize_dirs=true)
 Return the transformation corresponding to the rotation from one direction vector to another. More...
 
static RigidTransformN rotationAxisAngle (VectorT const &axis, Real radians)
 Construct a rotation specified by an angle (in radians) around an axis. More...
 
static RigidTransformN rotationEulerAnglesXYZ (Real yaw_radians, Real pitch_radians, Real roll_radians)
 Rotate about the Z axis by the roll angle, then the Y axis by the pitch angle, and finally the X axis by the yaw angle. More...
 
static RigidTransformN rotationEulerAnglesXZY (Real yaw_radians, Real pitch_radians, Real roll_radians)
 Rotate about the Y axis by the roll angle, then the Z axis by the pitch angle, and finally the X axis by the yaw angle. More...
 
static RigidTransformN rotationEulerAnglesYXZ (Real yaw_radians, Real pitch_radians, Real roll_radians)
 Rotate about the Z axis by the roll angle, then the X axis by the pitch angle, and finally the Y axis by the yaw angle. More...
 
static RigidTransformN rotationEulerAnglesYZX (Real yaw_radians, Real pitch_radians, Real roll_radians)
 Rotate about the X axis by the roll angle, then the Z axis by the pitch angle, and finally the Y axis by the yaw angle. More...
 
static RigidTransformN rotationEulerAnglesZXY (Real yaw_radians, Real pitch_radians, Real roll_radians)
 Rotate about the Y axis by the roll angle, then the X axis by the pitch angle, and finally the Z axis by the yaw angle. More...
 
static RigidTransformN rotationEulerAnglesZYX (Real yaw_radians, Real pitch_radians, Real roll_radians)
 Rotate about the X axis by the roll angle, then the Y axis by the pitch angle, and finally the Z axis by the yaw angle. More...
 
static RigidTransformN translation (T const &tx, T const &ty, T const &tz)
 Construct a translation. More...
 
static RigidTransformT translation (VectorT const &translation_)
 Construct a translation. More...
 

Detailed Description

template<typename T>
class Thea::RigidTransformN< 3, T >

A rigid transformation in 3-space, consisting of a rotation followed by a translation.

Note
While this is technically an affine transform, it restricts enough functionality to make a separate implementation preferable. It can be trivially converted to an AffineTransform3 using the implicit conversion operator or toAffine().

Definition at line 31 of file RigidTransform3.hpp.

Member Typedef Documentation

typedef RigidTransformN<N, T> RigidTransformT
inherited

N-dimensional rigid transform type.

Definition at line 41 of file RigidTransformN.hpp.

Constructor & Destructor Documentation

Default constructor.

Constructs the identity transform.

Definition at line 42 of file RigidTransform3.hpp.

Member Function Documentation

static RigidTransformT _fromAffine ( AffineTransformT const &  aff_)
staticinherited

Construct from an affine transform, assuming it is rigid (use with caution since it can break the rigidity guarantee).

Definition at line 62 of file RigidTransformN.hpp.

void _setRotation ( MatrixT const &  rot)
inherited

Set the rotation matrix (use with caution since it can break the rigidity guarantee).

Definition at line 82 of file RigidTransformN.hpp.

RigidTransformN<N, U> cast ( ) const
inherited

Cast the transform to a different scalar type.

Definition at line 70 of file RigidTransformN.hpp.

MatrixT const& getRotation ( ) const
inherited

Get rotation component.

Definition at line 79 of file RigidTransformN.hpp.

VectorT const& getTranslation ( ) const
inherited

Get translation component.

Definition at line 85 of file RigidTransformN.hpp.

Matrix<N + 1, N + 1, T> homogeneous ( ) const
inherited

Convert to an (N + 1) x (N + 1) transformation matrix in homogeneous coordinates (last row is identity).

Definition at line 94 of file RigidTransformN.hpp.

static RigidTransformT const& identity ( )
staticinherited

Get the identity transform.

Definition at line 133 of file RigidTransformN.hpp.

RigidTransformT inverse ( ) const
inherited

Get the inverse transform.

Definition at line 109 of file RigidTransformN.hpp.

operator AffineTransformT ( ) const
inherited

Convert to a general affine transform.

This may be less efficient than toAffine(), but the code looks cleaner (e.g. in a * b * c, each of the variables can be either AffineTransformT or RigidTransformT).

Definition at line 106 of file RigidTransformN.hpp.

Real operator() ( int  i,
int  j 
) const
inherited

Get an element of the N x (N + 1) matrix representing this transform.

Definition at line 116 of file RigidTransformN.hpp.

RigidTransformT operator* ( RigidTransformT const &  rhs) const
inherited

Compose this transform with another.

The other is applied first.

Definition at line 119 of file RigidTransformN.hpp.

VectorT operator* ( VectorT const &  v) const
inherited

Apply this transform to a N-vector.

Definition at line 122 of file RigidTransformN.hpp.

static RigidTransformN rotationArc ( VectorT const &  start_dir,
VectorT const &  end_dir,
bool  normalize_dirs = true 
)
static

Return the transformation corresponding to the rotation from one direction vector to another.

Parameters
start_dirThe vector to rotate from.
end_dirThe vector to rotate to.
normalize_dirsIf false, the directions will be assumed to have been pre-normalized to unit length before being passed to this function.

Definition at line 114 of file RigidTransform3.hpp.

static RigidTransformN rotationAxisAngle ( VectorT const &  axis,
Real  radians 
)
static

Construct a rotation specified by an angle (in radians) around an axis.

Definition at line 53 of file RigidTransform3.hpp.

static RigidTransformN rotationEulerAnglesXYZ ( Real  yaw_radians,
Real  pitch_radians,
Real  roll_radians 
)
static

Rotate about the Z axis by the roll angle, then the Y axis by the pitch angle, and finally the X axis by the yaw angle.

Definition at line 61 of file RigidTransform3.hpp.

static RigidTransformN rotationEulerAnglesXZY ( Real  yaw_radians,
Real  pitch_radians,
Real  roll_radians 
)
static

Rotate about the Y axis by the roll angle, then the Z axis by the pitch angle, and finally the X axis by the yaw angle.

Definition at line 69 of file RigidTransform3.hpp.

static RigidTransformN rotationEulerAnglesYXZ ( Real  yaw_radians,
Real  pitch_radians,
Real  roll_radians 
)
static

Rotate about the Z axis by the roll angle, then the X axis by the pitch angle, and finally the Y axis by the yaw angle.

Definition at line 77 of file RigidTransform3.hpp.

static RigidTransformN rotationEulerAnglesYZX ( Real  yaw_radians,
Real  pitch_radians,
Real  roll_radians 
)
static

Rotate about the X axis by the roll angle, then the Z axis by the pitch angle, and finally the Y axis by the yaw angle.

Definition at line 85 of file RigidTransform3.hpp.

static RigidTransformN rotationEulerAnglesZXY ( Real  yaw_radians,
Real  pitch_radians,
Real  roll_radians 
)
static

Rotate about the Y axis by the roll angle, then the X axis by the pitch angle, and finally the Z axis by the yaw angle.

Definition at line 93 of file RigidTransform3.hpp.

static RigidTransformN rotationEulerAnglesZYX ( Real  yaw_radians,
Real  pitch_radians,
Real  roll_radians 
)
static

Rotate about the X axis by the roll angle, then the Y axis by the pitch angle, and finally the Z axis by the yaw angle.

Definition at line 101 of file RigidTransform3.hpp.

void setIdentity ( )
inherited

Set the transform to identity.

Definition at line 76 of file RigidTransformN.hpp.

void setTranslation ( VectorT const &  translation_)
inherited

Set translation component.

Definition at line 88 of file RigidTransformN.hpp.

AffineTransformT const& toAffine ( ) const
inherited

Convert to a general affine transform.

This may be more efficient than the conversion operator since it explicitly omits any possible copying, but the code doesn't look as clean.

Definition at line 100 of file RigidTransformN.hpp.

Matrix<N, N + 1, T> toMatrix ( ) const
inherited

Convert to an N x (N + 1) transformation matrix.

Definition at line 91 of file RigidTransformN.hpp.

std::string toString ( ) const
inherited

Get a string representing the transform.

Definition at line 125 of file RigidTransformN.hpp.

static RigidTransformN translation ( T const &  tx,
T const &  ty,
T const &  tz 
)
static

Construct a translation.

Definition at line 47 of file RigidTransform3.hpp.

static RigidTransformT translation ( VectorT const &  translation_)
staticinherited

Construct a translation.

Definition at line 53 of file RigidTransformN.hpp.


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