#include <spTransformation2D.hpp>
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. | |
T | 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. |
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).
sp::scene::Transformation2D< T >::Transformation2D | ( | ) | [inline] |
sp::scene::Transformation2D< T >::Transformation2D | ( | const dim::matrix4< T > & | Matrix | ) | [inline] |
sp::scene::Transformation2D< T >::Transformation2D | ( | const dim::point2d< T > & | Position, | |
const T & | Rotation, | |||
const dim::size2d< T > & | Scale | |||
) | [inline] |
sp::scene::Transformation2D< T >::Transformation2D | ( | const Transformation2D< T > & | Other | ) | [inline] |
sp::scene::Transformation2D< T >::~Transformation2D | ( | ) | [inline] |
Transformation2D<T> sp::scene::Transformation2D< T >::getInverse | ( | ) | const [inline] |
Returns the inverse transformation.
dim::matrix4<T> sp::scene::Transformation2D< T >::getInverseMatrix | ( | ) | const [inline] |
Returns the inverse matrix.
dim::matrix4<T> sp::scene::Transformation2D< T >::getMatrix | ( | ) | const [inline] |
Returns the transformation as a 4x4 matrix.
void sp::scene::Transformation2D< T >::getMatrix | ( | dim::matrix4< T > & | Matrix | ) | const [inline] |
Transforms the given matrix by the current transformation.
dim::matrix4<T>& sp::scene::Transformation2D< T >::getMatrixDirect | ( | ) | [inline] |
Returns a reference of the matrix transformation.
dim::matrix4<T> sp::scene::Transformation2D< T >::getMatrixDirect | ( | ) | const [inline] |
Returns the matrix transformation directly.
dim::point2d<T> sp::scene::Transformation2D< T >::getPosition | ( | ) | const [inline] |
Returns the position vector.
T sp::scene::Transformation2D< T >::getRotation | ( | ) | const [inline] |
Returns the rotation quaternion.
dim::matrix4<T> sp::scene::Transformation2D< T >::getRotationMatrix | ( | ) | const [inline] |
Returns the rotation as 4x4 matrix.
dim::size2d<T> sp::scene::Transformation2D< T >::getScale | ( | ) | const [inline] |
Returns the scaling vector. By default ( 1 | 1 | 1 ).
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].
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.
Transformation2D<T> sp::scene::Transformation2D< T >::operator* | ( | const Transformation2D< T > & | Other | ) | const [inline] |
Transformation2D<T>& sp::scene::Transformation2D< T >::operator*= | ( | const Transformation2D< T > & | Other | ) | [inline] |
Transformation2D<T>& sp::scene::Transformation2D< T >::operator= | ( | const Transformation2D< T > & | Other | ) | [inline] |
void sp::scene::Transformation2D< T >::setMatrixDirect | ( | const dim::matrix4< T > & | Matrix | ) | [inline] |
Sets the final matrix transformation directly.
void sp::scene::Transformation2D< T >::setPosition | ( | const dim::point2d< T > & | Position | ) | [inline] |
Sets the position vector.
void sp::scene::Transformation2D< T >::setRotation | ( | const T & | Rotation | ) | [inline] |
Sets the rotation quaternion.
void sp::scene::Transformation2D< T >::setScale | ( | const dim::size2d< T > & | Scale | ) | [inline] |
Sets the scaling vector.
void sp::scene::Transformation2D< T >::transform | ( | const dim::size2d< T > & | Size | ) | [inline] |
Adds the specified size to the scaling vector.
void sp::scene::Transformation2D< T >::translate | ( | const dim::point2d< T > & | Direction | ) | [inline] |
Adds the specified direction to the position vector.
void sp::scene::Transformation2D< T >::turn | ( | const T & | Rotation | ) | [inline] |
Turns the transformation into the specified rotation.