|
| AffineTransform () |
| Construct a new identity transform.
|
|
const AffineTransform< T, N > | apply (const AffineTransform< T, N > &xf) const |
| Concatenation of transforms.
|
|
const VecType< T, N > | apply (const VecType< T, N > &p) const |
| Transformation of a point.
|
|
const VecType< T, N > | apply_direction (const VecType< T, N > &v) const |
| Transformation of a direction vector; ignores any translation.
|
|
const AffineTransform< T, N > | apply_inverse (const AffineTransform< T, N > &xf) const |
| Application of inverse.
|
|
const VecType< T, N > | apply_inverse (const VecType< T, N > &p) const |
| Inverse transformation of a point.
|
|
const VecType< T, N > | apply_inverse_direction (const VecType< T, N > &v) const |
| Inverse transformation of a direction vector; ignores any translation.
|
|
const VecType< T, N > | apply_inverse_normal (const VecType< T, N > &n) const |
| Inverse transformation of a normal.
|
|
const VecType< T, N > | apply_normal (const VecType< T, N > &n) const |
| Transformation of a normal.
|
|
const SimpleMatrix< T, N, N > | direction_matrix () const |
| Return the 3x3 matrix which transforms direction vectors.
|
|
const AffineTransform< T, N > | inverse () const |
|
template<typename U> |
| operator AffineTransform< U, N > () const |
| Cast elements to a different type.
|
|
AffineTransform< T, N > & | operator*= (const AffineTransform< T, N > &xf) |
| Concatenation of transforms.
|
|
AffineTransform< T, N > & | operator/= (const AffineTransform< T, N > &xf) |
| Apply inverse transform.
|
|
bool | operator== (const AffineTransform< T, N > &xf) const |
| Equality operator.
|
|
template<index_t M, typename U = T> |
AffineTransform< U, M > | resized () const |
|
|
Ray< T, N > | operator* (const AffineTransform< T, N > &xf, Ray< T, N > r) |
| Transformation of a ray.
|
|
VecType< T, N > | operator* (const AffineTransform< T, N > &xf, VecType< T, N > p) |
| Transformation of a point.
|
|
AffineTransform< T, N > | operator* (const AffineTransform< T, N > &xf1, const AffineTransform< T, N > &xf2) |
| Concatenation of transforms.
|
|
AffineTransform< T, N > | operator/ (const AffineTransform< T, N > &xf1, const AffineTransform< T, N > &xf2) |
| Inverse transform application.
|
|
Ray< T, N > | operator/ (Ray< T, N > r, const AffineTransform< T, N > &xf) |
| Inverse transformation of a ray (xf -1 * ray )
|
|
VecType< T, N > | operator/ (VecType< T, N > p, const AffineTransform< T, N > &xf) |
| Inverse transformation of a point (xf -1 * pt )
|
|
|
(Note that these are not member symbols.)
|
template<typename T> |
AffineTransform< T, 3 > | direction_align (const Vec< T, 3 > &dir, const Vec< T, 3 > &align_with) |
|
template<typename T> |
AffineTransform< T, 3 > | rotation (Quat< T > q) |
|
template<typename T> |
AffineTransform< T, 2 > | rotation (T radians) |
|
template<typename T> |
AffineTransform< T, 3 > | rotation (Vec< T, 3 > axis, const Vec< T, 3 > ¢er, T radians) |
|
template<typename T> |
AffineTransform< T, 3 > | rotation (Vec< T, 3 > axis, T radians) |
|
template<typename T, index_t N> |
AffineTransform< T, N > | scale (const Vec< T, N > &sx) |
|
template<typename T> |
AffineTransform< T, 2 > | scale (T sx, T sy) |
|
template<typename T> |
AffineTransform< T, 3 > | scale (T sx, T sy, T sz) |
|
template<typename T, index_t N, MatrixLayout Lyt, StoragePolicy P> |
AffineTransform< T, N > | transformation (const SimpleMatrix< T, N, N, Lyt, P > &mat) |
|
template<typename T, index_t N> |
AffineTransform< T, N > | translation (const Vec< T, N > &tx) |
|
template<typename T> |
AffineTransform< T, 2 > | translation (T tx, T ty) |
|
template<typename T> |
AffineTransform< T, 3 > | translation (T tx, T ty, T tz) |
|
template<typename T, index_t N>
class geom::AffineTransform< T, N >
Affine transformation class.
AffineTransforms may represent any linear transformation, including rotations, translations, nonuniform scales, and shears. They are represented by an (N+1) x (N+1) matrix, where the last row is [0,0,...,1].
AffineTransforms meet the Transform concept. For transforms that preserve angles and relative distances, see Similarity. For transforms that preserve distance, see Isometry. For pure rotations, see Rotation.
Vectors are assumed to be columns; therefore a transformation is ordered like:
T * v
and so:
A * B * v
applies B to v, then A to the result.
The transform which "undoes" a transform can be obtained with xf.inverse()
. Because an AffineTransform internally stores both itself and its inverse, this construction is fairly inexpensive, as are all inverse-application functions.
Construction
Transforms are best constructed using the provided methods:
Vec<double,3> v = ... ;
AffineTransform<double,3> xf = rotation(axis, angle);
xf *= translation(v);
xf *= scale(v);
xf *= transformation(mat3x3);
These methods will generally be most efficient and robust, especially when constructing the internal inverse transformation matrix needed by AffineTransform objects.