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

A coordinate frame in 3-space, defined by three orthonormal vectors. More...

#include <CoordinateFrame3.hpp>

Inheritance diagram for CoordinateFrameN< 3, T >:
CoordinateFrameNBase< 3, T > RigidTransformN< N, T > RigidTransformNBase< N, T >

Public Types

typedef AffineTransformN< N, T > AffineTransformT
 N-dimensional affine transform. More...
 
typedef CoordinateFrameN< N, T > CoordinateFrameT
 N-dimensional coordinate frame 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...
 
template<typename U >
RigidTransformN< N, U > cast () const
 Cast the transform to a different scalar type. More...
 
 CoordinateFrameN ()
 Default constructor. More...
 
 CoordinateFrameN (RigidTransformT const &src)
 Construct from a rigid transform. More...
 
VectorT getAxis (intx i) const
 Get an axis of the frame. 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...
 
CoordinateFrameT inverse () const
 Get the inverse transform. More...
 
VectorT lookVector () const
 Get the viewing direction (the negative Z axis of the frame). More...
 
VectorT normalToObjectSpace (VectorT const &n) const
 Transform a normal from world space to the local space of the coordinate frame. More...
 
VectorT normalToWorldSpace (VectorT const &n) const
 Transform a normal from the local space of the coordinate frame to world space. 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...
 
CoordinateFrameT operator* (CoordinateFrameT const &rhs) const
 Compose this frame, treated as a rigid transform, with another. More...
 
VectorT operator* (VectorT const &p) const
 Transform a point from the local space of the coordinate frame to world space. More...
 
VectorT pointToObjectSpace (VectorT const &p) const
 Transform a point from world space to the local space of the coordinate frame. More...
 
VectorT pointToWorldSpace (VectorT const &p) const
 Transform a point from the local space of the coordinate frame to world space. More...
 
VectorT rightVector () const
 Get the right-hand direction (the X axis of the frame). More...
 
void setIdentity ()
 Set the transform to identity. More...
 
void setTranslation (VectorT const &translation_)
 Set translation component. More...
 
void setViewFrame (VectorT const &eye, VectorT const &look_at, VectorT const &up)
 Initialize from a viewing position (eye), look-at position (look_at) and up direction (up). 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...
 
VectorT upVector () const
 Get the up direction (the Y axis of the frame). More...
 
VectorT vectorToObjectSpace (VectorT const &v) const
 Transform a direction vector from world space to the local space of the coordinate frame. More...
 
VectorT vectorToWorldSpace (VectorT const &v) const
 Transform a direction vector from the local space of the coordinate frame to world space. More...
 

Static Public Member Functions

static CoordinateFrameT _fromAffine (AffineTransformT const &aff_)
 Construct from an affine transform, assuming it is rigid (use with caution since it can break the orthonormality guarantee). More...
 
static CoordinateFrameN fromViewFrame (VectorT const &eye, VectorT const &look_at, VectorT const &up)
 Construct from a viewing position (eye), look-at position (look_at) and up direction (up). More...
 
static CoordinateFrameT const & identity ()
 Get the identity frame (same as the world frame). More...
 

Detailed Description

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

A coordinate frame in 3-space, defined by three orthonormal vectors.

Definition at line 25 of file CoordinateFrame3.hpp.

Member Typedef Documentation

typedef AffineTransformN<N, T> AffineTransformT
inherited

N-dimensional affine transform.

Definition at line 39 of file CoordinateFrameN.hpp.

typedef CoordinateFrameN<N, T> CoordinateFrameT
inherited

N-dimensional coordinate frame type.

Definition at line 37 of file CoordinateFrameN.hpp.

Constructor & Destructor Documentation

Default constructor.

Constructs the identity frame.

Definition at line 36 of file CoordinateFrame3.hpp.

Construct from a rigid transform.

Definition at line 39 of file CoordinateFrame3.hpp.

Member Function Documentation

static CoordinateFrameT _fromAffine ( AffineTransformT const &  aff_)
staticinherited

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

Definition at line 55 of file CoordinateFrameN.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.

static CoordinateFrameN fromViewFrame ( VectorT const &  eye,
VectorT const &  look_at,
VectorT const &  up 
)
static

Construct from a viewing position (eye), look-at position (look_at) and up direction (up).

The up direction need not be exactly orthogonal to look_at - eye or be a unit vector.

Definition at line 45 of file CoordinateFrame3.hpp.

VectorT getAxis ( intx  i) const
inherited

Get an axis of the frame.

Definition at line 61 of file CoordinateFrameN.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 CoordinateFrameT const& identity ( )
staticinherited

Get the identity frame (same as the world frame).

Definition at line 118 of file CoordinateFrameN.hpp.

CoordinateFrameT inverse ( ) const
inherited

Get the inverse transform.

Definition at line 64 of file CoordinateFrameN.hpp.

VectorT lookVector ( ) const

Get the viewing direction (the negative Z axis of the frame).

Definition at line 71 of file CoordinateFrame3.hpp.

VectorT normalToObjectSpace ( VectorT const &  n) const
inherited

Transform a normal from world space to the local space of the coordinate frame.

Definition at line 112 of file CoordinateFrameN.hpp.

VectorT normalToWorldSpace ( VectorT const &  n) const
inherited

Transform a normal from the local space of the coordinate frame to world space.

Definition at line 106 of file CoordinateFrameN.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.

CoordinateFrameT operator* ( CoordinateFrameT const &  rhs) const
inherited

Compose this frame, treated as a rigid transform, with another.

The other is applied first.

Definition at line 70 of file CoordinateFrameN.hpp.

VectorT operator* ( VectorT const &  p) const
inherited

Transform a point from the local space of the coordinate frame to world space.

Definition at line 76 of file CoordinateFrameN.hpp.

VectorT pointToObjectSpace ( VectorT const &  p) const
inherited

Transform a point from world space to the local space of the coordinate frame.

Definition at line 88 of file CoordinateFrameN.hpp.

VectorT pointToWorldSpace ( VectorT const &  p) const
inherited

Transform a point from the local space of the coordinate frame to world space.

Definition at line 82 of file CoordinateFrameN.hpp.

VectorT rightVector ( ) const

Get the right-hand direction (the X axis of the frame).

Definition at line 83 of file CoordinateFrame3.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.

void setViewFrame ( VectorT const &  eye,
VectorT const &  look_at,
VectorT const &  up 
)

Initialize from a viewing position (eye), look-at position (look_at) and up direction (up).

The up direction need not be exactly orthogonal to look_at - eye or be a unit vector.

Definition at line 56 of file CoordinateFrame3.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.

VectorT upVector ( ) const

Get the up direction (the Y axis of the frame).

Definition at line 77 of file CoordinateFrame3.hpp.

VectorT vectorToObjectSpace ( VectorT const &  v) const
inherited

Transform a direction vector from world space to the local space of the coordinate frame.

Definition at line 100 of file CoordinateFrameN.hpp.

VectorT vectorToWorldSpace ( VectorT const &  v) const
inherited

Transform a direction vector from the local space of the coordinate frame to world space.

Definition at line 94 of file CoordinateFrameN.hpp.


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