Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Public Attributes | List of all members
om::math::Transform3D< T > Class Template Reference

A class that represents a 3-dimensional transformation. More...

#include <omTransform3D.h>

Public Member Functions

 Transform3D ()
 Create an identity transformation that doesn't modify transformed points. More...
 
 Transform3D (const VectorND< T, 3 > &newPosition)
 Create a transformation with the specified translation and no rotation or scaling. More...
 
 Transform3D (const VectorND< T, 3 > &newPosition, const MatrixND< T, 3, 3 > &newOrientation)
 Create a transformation with the specified translation, rotation, and no scaling. More...
 
 Transform3D (const VectorND< T, 3 > &newPosition, const MatrixND< T, 3, 3 > &newOrientation, T newScale)
 Create a transformation with the specified translation, rotation, and uniform scaling. More...
 
 Transform3D (const VectorND< T, 3 > &newPosition, const MatrixND< T, 3, 3 > &newOrientation, const VectorND< T, 3 > &newScale)
 Create a transformation with the specified translation, rotation, and uniform scaling. More...
 
VectorND< T, 3 > transformToLocal (T original) const
 Transform the specified scalar value to object space. More...
 
VectorND< T, 3 > transformToLocal (const VectorND< T, 3 > &original) const
 Transform the specified position vector to object space. More...
 
MatrixND< T, 3, 3 > transformToLocal (const MatrixND< T, 3, 3 > &original) const
 Transform the specified matrix to object space. More...
 
Ray3D< T > transformToLocal (const Ray3D< T > &ray) const
 Transform the specified ray into object space. More...
 
Plane3D< T > transformToLocal (const Plane3D< T > &plane) const
 Transform the specified plane into object space. More...
 
AABB3D< T > transformToLocal (const AABB3D< T > &box) const
 Transform the specified axis-aligned box into object space, producing another axis-aligned box that encloses the original. More...
 
VectorND< T, 3 > rotateToLocal (const VectorND< T, 3 > &original) const
 Rotate the specified vector to object space. More...
 
VectorND< T, 3 > scaleToLocal (const VectorND< T, 3 > &original) const
 Scale a vector to object space. More...
 
VectorND< T, 3 > transformToWorld (T original) const
 Transform the specified scalar value to world space. More...
 
VectorND< T, 3 > transformToWorld (const VectorND< T, 3 > &original) const
 Transform the specified position vector from object to world space. More...
 
MatrixND< T, 3, 3 > transformToWorld (const MatrixND< T, 3, 3 > &original) const
 Transform the specified matrix from object to world space. More...
 
Ray3D< T > transformToWorld (const Ray3D< T > &ray) const
 Transform the specified ray into world space. More...
 
Plane3D< T > transformToWorld (const Plane3D< T > &plane) const
 Transform the specified plane into world space. More...
 
AABB3D< T > transformToWorld (const AABB3D< T > &box) const
 Transform the specified axis-aligned box into world space, producing another axis-aligned box that encloses the original. More...
 
VectorND< T, 3 > rotateToWorld (const VectorND< T, 3 > &original) const
 Rotate the specified vector to world space. More...
 
VectorND< T, 3 > scaleToWorld (const VectorND< T, 3 > &original) const
 Scale a vector to world space. More...
 
operator* (T value) const
 Scale the specified value to world space with this transformation. More...
 
VectorND< T, 3 > operator* (const VectorND< T, 3 > &vector) const
 Transform the specified vector to world space with this transformation. More...
 
MatrixND< T, 3, 3 > operator* (const MatrixND< T, 3, 3 > &matrix) const
 Transform the specified matrix to world space with this transformation. More...
 
Ray3D< T > operator* (const Ray3D< T > &ray) const
 Transform the specified ray to world space with this transformation. More...
 
Plane3D< T > operator* (const Plane3D< T > &plane) const
 Transform the specified plane to world space with this transformation. More...
 
Transform3D< T > operator* (const Transform3D< T > &other) const
 Concatenate this transformation with another and return the combined transformation. More...
 
Transform3D< T > invert () const
 Return the inverse of this transformations that applys the opposite transformation. More...
 
MatrixND< T, 4, 4 > toMatrix () const
 Convert this transformation into a 4x4 homogeneous-coordinate matrix. More...
 
MatrixND< T, 4, 4 > toMatrixInverse () const
 Convert the inverse of this transformation into a 4x4 homogeneous-coordinate matrix. More...
 

Public Attributes

VectorND< T, 3 > position
 The translation component of the rigid transformation. More...
 
MatrixND< T, 3, 3 > orientation
 The rotation component of the rigid transformation. More...
 
VectorND< T, 3 > scale
 The scaling component of the rigid transformation. More...
 

Detailed Description

template<typename T>
class om::math::Transform3D< T >

A class that represents a 3-dimensional transformation.

The transformation is composed of translation, rotation, and scaling. The components are assumed to be in the following order: translation, rotation, and scaling. Thus, when transforming a point from world to object space by the transformation, translation is first applied, followed by scaling, and finally rotation. The reverse holds true for transformations from object to world space.

Constructor & Destructor Documentation

template<typename T>
om::math::Transform3D< T >::Transform3D ( )
inline

Create an identity transformation that doesn't modify transformed points.

template<typename T>
om::math::Transform3D< T >::Transform3D ( const VectorND< T, 3 > &  newPosition)
inline

Create a transformation with the specified translation and no rotation or scaling.

template<typename T>
om::math::Transform3D< T >::Transform3D ( const VectorND< T, 3 > &  newPosition,
const MatrixND< T, 3, 3 > &  newOrientation 
)
inline

Create a transformation with the specified translation, rotation, and no scaling.

template<typename T>
om::math::Transform3D< T >::Transform3D ( const VectorND< T, 3 > &  newPosition,
const MatrixND< T, 3, 3 > &  newOrientation,
newScale 
)
inline

Create a transformation with the specified translation, rotation, and uniform scaling.

template<typename T>
om::math::Transform3D< T >::Transform3D ( const VectorND< T, 3 > &  newPosition,
const MatrixND< T, 3, 3 > &  newOrientation,
const VectorND< T, 3 > &  newScale 
)
inline

Create a transformation with the specified translation, rotation, and uniform scaling.

Member Function Documentation

template<typename T>
VectorND<T,3> om::math::Transform3D< T >::transformToLocal ( original) const
inline

Transform the specified scalar value to object space.

This will perform any scaling necessary to satisfy the transformation.

template<typename T>
VectorND<T,3> om::math::Transform3D< T >::transformToLocal ( const VectorND< T, 3 > &  original) const
inline

Transform the specified position vector to object space.

template<typename T>
MatrixND<T,3,3> om::math::Transform3D< T >::transformToLocal ( const MatrixND< T, 3, 3 > &  original) const
inline

Transform the specified matrix to object space.

This returns what the specified matrix would be in this transformation's coordinate frame. This method does not perform any scaling on the input matrix. The input matrix is assumed to be an orthonormal rotation matrix.

template<typename T>
Ray3D<T> om::math::Transform3D< T >::transformToLocal ( const Ray3D< T > &  ray) const
inline

Transform the specified ray into object space.

This method performs a standard vector transformation for the ray origin and only rotates the ray direction, preserving the length of the ray's direction vector.

template<typename T>
Plane3D<T> om::math::Transform3D< T >::transformToLocal ( const Plane3D< T > &  plane) const
inline

Transform the specified plane into object space.

This method rotates the normal of the plane into the new coordinate frame and calculates a new offset for the plane based on the projection of the origin onto the plane in world space transformed to object space.

template<typename T>
AABB3D<T> om::math::Transform3D< T >::transformToLocal ( const AABB3D< T > &  box) const
inline

Transform the specified axis-aligned box into object space, producing another axis-aligned box that encloses the original.

template<typename T>
VectorND<T,3> om::math::Transform3D< T >::rotateToLocal ( const VectorND< T, 3 > &  original) const
inline

Rotate the specified vector to object space.

This method does not perform any translation or scaling on the input point. This function is ideal for transforming directional quantities like surface normal vectors.

template<typename T>
VectorND<T,3> om::math::Transform3D< T >::scaleToLocal ( const VectorND< T, 3 > &  original) const
inline

Scale a vector to object space.

template<typename T>
VectorND<T,3> om::math::Transform3D< T >::transformToWorld ( original) const
inline

Transform the specified scalar value to world space.

This will perform any scaling necessary to satisfy the transformation.

template<typename T>
VectorND<T,3> om::math::Transform3D< T >::transformToWorld ( const VectorND< T, 3 > &  original) const
inline

Transform the specified position vector from object to world space.

template<typename T>
MatrixND<T,3,3> om::math::Transform3D< T >::transformToWorld ( const MatrixND< T, 3, 3 > &  original) const
inline

Transform the specified matrix from object to world space.

This returns what the specified matrix would be in this transformation's coordinate frame. This method does not perform any scaling on the input matrix. The input matrix is assumed to be an orthonormal rotation matrix.

template<typename T>
Ray3D<T> om::math::Transform3D< T >::transformToWorld ( const Ray3D< T > &  ray) const
inline

Transform the specified ray into world space.

This method performs a standard vector transformation for the ray origin and only rotates the ray direction, preserving the length of the ray's direction vector.

template<typename T>
Plane3D<T> om::math::Transform3D< T >::transformToWorld ( const Plane3D< T > &  plane) const
inline

Transform the specified plane into world space.

This method rotates the normal of the plane into the new coordinate frame and calculates a new offset for the plane based on the projection of the origin onto the plane in object space transformed to world space.

template<typename T>
AABB3D<T> om::math::Transform3D< T >::transformToWorld ( const AABB3D< T > &  box) const
inline

Transform the specified axis-aligned box into world space, producing another axis-aligned box that encloses the original.

template<typename T>
VectorND<T,3> om::math::Transform3D< T >::rotateToWorld ( const VectorND< T, 3 > &  original) const
inline

Rotate the specified vector to world space.

This method does not perform any translation or scaling on the input point. This function is ideal for transforming directional quantities like surface normal vectors.

template<typename T>
VectorND<T,3> om::math::Transform3D< T >::scaleToWorld ( const VectorND< T, 3 > &  original) const
inline

Scale a vector to world space.

template<typename T>
T om::math::Transform3D< T >::operator* ( value) const
inline

Scale the specified value to world space with this transformation.

template<typename T>
VectorND<T,3> om::math::Transform3D< T >::operator* ( const VectorND< T, 3 > &  vector) const
inline

Transform the specified vector to world space with this transformation.

template<typename T>
MatrixND<T,3,3> om::math::Transform3D< T >::operator* ( const MatrixND< T, 3, 3 > &  matrix) const
inline

Transform the specified matrix to world space with this transformation.

template<typename T>
Ray3D<T> om::math::Transform3D< T >::operator* ( const Ray3D< T > &  ray) const
inline

Transform the specified ray to world space with this transformation.

template<typename T>
Plane3D<T> om::math::Transform3D< T >::operator* ( const Plane3D< T > &  plane) const
inline

Transform the specified plane to world space with this transformation.

template<typename T>
Transform3D<T> om::math::Transform3D< T >::operator* ( const Transform3D< T > &  other) const
inline

Concatenate this transformation with another and return the combined transformation.

This transformation represents the total transformation from object space of the other, into this transformation's object space, and then to world space.

template<typename T>
Transform3D<T> om::math::Transform3D< T >::invert ( ) const
inline

Return the inverse of this transformations that applys the opposite transformation.

template<typename T>
MatrixND<T,4,4> om::math::Transform3D< T >::toMatrix ( ) const
inline

Convert this transformation into a 4x4 homogeneous-coordinate matrix.

template<typename T>
MatrixND<T,4,4> om::math::Transform3D< T >::toMatrixInverse ( ) const
inline

Convert the inverse of this transformation into a 4x4 homogeneous-coordinate matrix.

Member Data Documentation

template<typename T>
VectorND<T,3> om::math::Transform3D< T >::position

The translation component of the rigid transformation.

template<typename T>
MatrixND<T,3,3> om::math::Transform3D< T >::orientation

The rotation component of the rigid transformation.

template<typename T>
VectorND<T,3> om::math::Transform3D< T >::scale

The scaling component of the rigid transformation.


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