Public Member Functions

sp::scene::Transformation2D< T > Class Template Reference

#include <spTransformation2D.hpp>

List of all members.

Public Member Functions

 Transformation2D ()
 Transformation2D (const dim::matrix4< T > &Matrix)
 Transformation2D (const dim::point2d< T > &Position, const T &Rotation, const dim::size2d< T > &Scale)
 Transformation2D (const Transformation2D< T > &Other)
 ~Transformation2D ()
Transformation2D< T > & operator= (const Transformation2D< T > &Other)
Transformation2D< T > & operator*= (const Transformation2D< T > &Other)
Transformation2D< T > operator* (const Transformation2D< T > &Other) const
dim::matrix4< T > getMatrix () const
 Returns the transformation as a 4x4 matrix.
Transformation2D< T > getInverse () const
 Returns the inverse transformation.
void interpolate (const Transformation2D< T > &From, const Transformation2D< T > &To, const T &Interpolation)
 Interpolates this transformation between the given ones with the specified factor which is in the range [0.0 .. 1.0].
void move (const dim::point2d< T > &Direction)
 Moves the transformation into the specified direction. This depends on the current rotation.
void turn (const T &Rotation)
 Turns the transformation into the specified rotation.
void setPosition (const dim::point2d< T > &Position)
 Sets the position vector.
dim::point2d< T > getPosition () const
 Returns the position vector.
void setRotation (const T &Rotation)
 Sets the rotation quaternion.
getRotation () const
 Returns the rotation quaternion.
dim::matrix4< T > getRotationMatrix () const
 Returns the rotation as 4x4 matrix.
void setScale (const dim::size2d< T > &Scale)
 Sets the scaling vector.
dim::size2d< T > getScale () const
 Returns the scaling vector. By default ( 1 | 1 | 1 ).
void translate (const dim::point2d< T > &Direction)
 Adds the specified direction to the position vector.
void transform (const dim::size2d< T > &Size)
 Adds the specified size to the scaling vector.
void getMatrix (dim::matrix4< T > &Matrix) const
 Transforms the given matrix by the current transformation.
dim::matrix4< T > getInverseMatrix () const
void setMatrixDirect (const dim::matrix4< T > &Matrix)
dim::matrix4< T > & getMatrixDirect ()
 Returns a reference of the matrix transformation.
dim::matrix4< T > getMatrixDirect () const
 Returns the matrix transformation directly.

Detailed Description

template<typename T>
class sp::scene::Transformation2D< T >

2D transformation class. This is not a base class. Unlike 3D transformation in 2D, most transformations are done without matrices or some kind of that. But it can be used for a more structured transformation. This transformation is stored as position (2D Point), rotation (Single value) and scale (2D Size).

See also:
point2d
size2d
Since:
Version 3.2

Constructor & Destructor Documentation

template<typename T>
sp::scene::Transformation2D< T >::Transformation2D (  )  [inline]
template<typename T>
sp::scene::Transformation2D< T >::Transformation2D ( const dim::matrix4< T > &  Matrix  )  [inline]
template<typename T>
sp::scene::Transformation2D< T >::Transformation2D ( const dim::point2d< T > &  Position,
const T &  Rotation,
const dim::size2d< T > &  Scale 
) [inline]
template<typename T>
sp::scene::Transformation2D< T >::Transformation2D ( const Transformation2D< T > &  Other  )  [inline]
template<typename T>
sp::scene::Transformation2D< T >::~Transformation2D (  )  [inline]

Member Function Documentation

template<typename T>
Transformation2D<T> sp::scene::Transformation2D< T >::getInverse (  )  const [inline]

Returns the inverse transformation.

template<typename T>
dim::matrix4<T> sp::scene::Transformation2D< T >::getInverseMatrix (  )  const [inline]

Returns the inverse matrix.

See also:
getMatrix
template<typename T>
dim::matrix4<T> sp::scene::Transformation2D< T >::getMatrix (  )  const [inline]

Returns the transformation as a 4x4 matrix.

template<typename T>
void sp::scene::Transformation2D< T >::getMatrix ( dim::matrix4< T > &  Matrix  )  const [inline]

Transforms the given matrix by the current transformation.

template<typename T>
dim::matrix4<T>& sp::scene::Transformation2D< T >::getMatrixDirect (  )  [inline]

Returns a reference of the matrix transformation.

template<typename T>
dim::matrix4<T> sp::scene::Transformation2D< T >::getMatrixDirect (  )  const [inline]

Returns the matrix transformation directly.

template<typename T>
dim::point2d<T> sp::scene::Transformation2D< T >::getPosition (  )  const [inline]

Returns the position vector.

template<typename T>
T sp::scene::Transformation2D< T >::getRotation (  )  const [inline]

Returns the rotation quaternion.

template<typename T>
dim::matrix4<T> sp::scene::Transformation2D< T >::getRotationMatrix (  )  const [inline]

Returns the rotation as 4x4 matrix.

template<typename T>
dim::size2d<T> sp::scene::Transformation2D< T >::getScale (  )  const [inline]

Returns the scaling vector. By default ( 1 | 1 | 1 ).

template<typename T>
void sp::scene::Transformation2D< T >::interpolate ( const Transformation2D< T > &  From,
const Transformation2D< T > &  To,
const T &  Interpolation 
) [inline]

Interpolates this transformation between the given ones with the specified factor which is in the range [0.0 .. 1.0].

template<typename T>
void sp::scene::Transformation2D< T >::move ( const dim::point2d< T > &  Direction  )  [inline]

Moves the transformation into the specified direction. This depends on the current rotation.

template<typename T>
Transformation2D<T> sp::scene::Transformation2D< T >::operator* ( const Transformation2D< T > &  Other  )  const [inline]
template<typename T>
Transformation2D<T>& sp::scene::Transformation2D< T >::operator*= ( const Transformation2D< T > &  Other  )  [inline]
template<typename T>
Transformation2D<T>& sp::scene::Transformation2D< T >::operator= ( const Transformation2D< T > &  Other  )  [inline]
template<typename T>
void sp::scene::Transformation2D< T >::setMatrixDirect ( const dim::matrix4< T > &  Matrix  )  [inline]

Sets the final matrix transformation directly.

Note:
This will be overwritten the next time "getMatrix" is called!
template<typename T>
void sp::scene::Transformation2D< T >::setPosition ( const dim::point2d< T > &  Position  )  [inline]

Sets the position vector.

template<typename T>
void sp::scene::Transformation2D< T >::setRotation ( const T &  Rotation  )  [inline]

Sets the rotation quaternion.

template<typename T>
void sp::scene::Transformation2D< T >::setScale ( const dim::size2d< T > &  Scale  )  [inline]

Sets the scaling vector.

template<typename T>
void sp::scene::Transformation2D< T >::transform ( const dim::size2d< T > &  Size  )  [inline]

Adds the specified size to the scaling vector.

template<typename T>
void sp::scene::Transformation2D< T >::translate ( const dim::point2d< T > &  Direction  )  [inline]

Adds the specified direction to the position vector.

template<typename T>
void sp::scene::Transformation2D< T >::turn ( const T &  Rotation  )  [inline]

Turns the transformation into the specified rotation.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines