Main Page | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

LinAlg::Transform2< T > Class Template Reference

#include <Transform2.h>

Inheritance diagram for LinAlg::Transform2< T >:

LinAlg::Mat3< T > List of all members.

Detailed Description

template<typename T>
class LinAlg::Transform2< T >

A 2D affine transformation represented as a 3x3 matrix.

This version supports translation, rotation, and uniform scales.


Public Member Functions

 Transform2 ()
 The identity transform.

 Transform2 (const Mat3< T > &values)
 Initialize from a matrix of values.

 Transform2 (const Matrix< T, 3 > &values)
 Initialize from a matrix of values.

 Transform2 (const Mat2< T > &R, const Vec2< T > &t)
 Initialize from a rotation/scaling matrix and a translation vector.

 Transform2 (const Transform2 &other)
 Copy an affine transform.

Transform2operator= (const Transform2 &other)
 Assign an affine transform to this one.

getScale () const
 Return the uniform scaling factor.

getScaleSqr () const
 Return the uniform scaling factor squared.

Vec2< T > getTranslation () const
 Return the translation.

Transform2 inverse () const
 Calculate the inverse of the transfromation.

Vec2< T > transPoint (const Vec2< T > &v) const
 Transform a point.

Vec2< T > transVector (const Vec2< T > &v) const
 Transform a vector.


Static Public Member Functions

Various affine transforms creators.
Transform2 identity ()
 Return the identity transform.

Transform2 translation (const Vec2< T > &v)
 Return a translation transform.

Transform2 scale (const T &s)
 Return a uniform scaling transform.

Transform2 rotation (const T angle)
 Return a rotation transform of angle radians about the origin.


Member Function Documentation

template<typename T>
Transform2 LinAlg::Transform2< T >::rotation const T  angle  )  [inline, static]
 

Return a rotation transform of angle radians about the origin.

Note:
This clearly won't work very well for integer types T.


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

© 2005-2008 Adrian Secord.