Thea
|
A coordinate frame in 3-space, defined by three orthonormal vectors. More...
#include <CoordinateFrame3.hpp>
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... | |
A coordinate frame in 3-space, defined by three orthonormal vectors.
Definition at line 25 of file CoordinateFrame3.hpp.
|
inherited |
N-dimensional affine transform.
Definition at line 39 of file CoordinateFrameN.hpp.
|
inherited |
N-dimensional coordinate frame type.
Definition at line 37 of file CoordinateFrameN.hpp.
CoordinateFrameN | ( | ) |
Default constructor.
Constructs the identity frame.
Definition at line 36 of file CoordinateFrame3.hpp.
CoordinateFrameN | ( | RigidTransformT const & | src | ) |
Construct from a rigid transform.
Definition at line 39 of file CoordinateFrame3.hpp.
|
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.
|
inherited |
Set the rotation matrix (use with caution since it can break the rigidity guarantee).
Definition at line 82 of file RigidTransformN.hpp.
|
inherited |
Cast the transform to a different scalar type.
Definition at line 70 of file RigidTransformN.hpp.
|
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.
|
inherited |
Get an axis of the frame.
Definition at line 61 of file CoordinateFrameN.hpp.
|
inherited |
Get rotation component.
Definition at line 79 of file RigidTransformN.hpp.
|
inherited |
Get translation component.
Definition at line 85 of file RigidTransformN.hpp.
|
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.
|
staticinherited |
Get the identity frame (same as the world frame).
Definition at line 118 of file CoordinateFrameN.hpp.
|
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.
|
inherited |
Transform a normal from world space to the local space of the coordinate frame.
Definition at line 112 of file CoordinateFrameN.hpp.
|
inherited |
Transform a normal from the local space of the coordinate frame to world space.
Definition at line 106 of file CoordinateFrameN.hpp.
|
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.
|
inherited |
Get an element of the N x (N + 1) matrix representing this transform.
Definition at line 116 of file RigidTransformN.hpp.
|
inherited |
Compose this frame, treated as a rigid transform, with another.
The other is applied first.
Definition at line 70 of file CoordinateFrameN.hpp.
|
inherited |
Transform a point from the local space of the coordinate frame to world space.
Definition at line 76 of file CoordinateFrameN.hpp.
|
inherited |
Transform a point from world space to the local space of the coordinate frame.
Definition at line 88 of file CoordinateFrameN.hpp.
|
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.
|
inherited |
Set the transform to identity.
Definition at line 76 of file RigidTransformN.hpp.
|
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.
|
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.
|
inherited |
Convert to an N x (N + 1) transformation matrix.
Definition at line 91 of file RigidTransformN.hpp.
|
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.
|
inherited |
Transform a direction vector from world space to the local space of the coordinate frame.
Definition at line 100 of file CoordinateFrameN.hpp.
|
inherited |
Transform a direction vector from the local space of the coordinate frame to world space.
Definition at line 94 of file CoordinateFrameN.hpp.