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

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

#include <omTransform2D.h>

Public Member Functions

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

Public Attributes

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

Detailed Description

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

A class that represents a 2-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::Transform2D< T >::Transform2D ( )
inline

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

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

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

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

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

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

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

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

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

Member Function Documentation

template<typename T >
VectorND<T,2> om::math::Transform2D< 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,2> om::math::Transform2D< T >::transformToLocal ( const VectorND< T, 2 > &  original) const
inline

Transform the specified position vector to object space.

template<typename T >
MatrixND<T,2,2> om::math::Transform2D< T >::transformToLocal ( const MatrixND< T, 2, 2 > &  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 >
AABB2D<T> om::math::Transform2D< T >::transformToLocal ( const AABB2D< 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,2> om::math::Transform2D< T >::rotateToLocal ( const VectorND< T, 2 > &  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,2> om::math::Transform2D< T >::scaleToLocal ( const VectorND< T, 2 > &  original) const
inline

Scale a vector to object space.

template<typename T >
VectorND<T,2> om::math::Transform2D< 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,2> om::math::Transform2D< T >::transformToWorld ( const VectorND< T, 2 > &  original) const
inline

Transform the specified position vector to world space.

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

Transform the specified matrix 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 >
AABB2D<T> om::math::Transform2D< T >::transformToWorld ( const AABB2D< 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,2> om::math::Transform2D< T >::rotateToWorld ( const VectorND< T, 2 > &  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,2> om::math::Transform2D< T >::scaleToWorld ( const VectorND< T, 2 > &  original) const
inline

Scale a vector to world space.

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

Scale the specified value to world space with this transformation.

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

Transform the specified vector to world space with this transformation.

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

Transform the specified matrix to world space with this transformation.

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

Transform the specified ray to world space with this transformation.

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

Transform the specified plane to world space with this transformation.

template<typename T >
Transform2D<T> om::math::Transform2D< T >::operator* ( const Transform2D< 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 >
Transform2D<T> om::math::Transform2D< T >::invert ( ) const
inline

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

template<typename T >
MatrixND<T,3,3> om::math::Transform2D< T >::toMatrix ( ) const
inline

Convert this transformation into a 3x3 homogeneous-coordinate matrix.

template<typename T >
MatrixND<T,3,3> om::math::Transform2D< T >::toMatrixInverse ( ) const
inline

Convert the inverse of this transformation into a 3x3 homogeneous-coordinate matrix.

template<typename T >
MatrixND<T,4,4> om::math::Transform2D< T >::toMatrix4 ( ) const
inline

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

template<typename T >
MatrixND<T,4,4> om::math::Transform2D< T >::toMatrix4Inverse ( ) const
inline

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

Member Data Documentation

template<typename T >
VectorND<T,2> om::math::Transform2D< T >::position

The translation component of the rigid transformation.

template<typename T >
MatrixND<T,2,2> om::math::Transform2D< T >::orientation

The rotation component of the rigid transformation.

template<typename T >
VectorND<T,2> om::math::Transform2D< T >::scale

The scaling component of the rigid transformation.


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