Geometrical 3D transformation stack. More...
#include <Luminous/Transformer.hpp>
Public Member Functions | |
| void | leftMul (const Nimble::Matrix4 &m) |
| Multiply the top matrix from the left with the given matrix The end result is equivalent to: More... | |
| void | popTransform () |
| Pops the top matrix from the stack. | |
| Nimble::Vector2 | project (const Nimble::Vector2 &) const |
| Apply the current transformation matrix on a 2D vector. | |
| void | pushTransform () |
| Push a new matrix to the stack, just copying the current top. | |
| void | pushTransform (const Nimble::Matrix4 &m) |
| Push the given matrix to the stack pushTransform(m) has the same effect as: More... | |
| void | pushTransform (const Nimble::Matrix3 &m) |
| void | pushTransformLeftMul (const Nimble::Matrix4 &m) |
| Multiply the top matrix from the left with the given matrix and push the result into the stack. | |
| void | pushTransformLeftMul (const Nimble::Matrix3 &m) |
| void | pushTransformRightMul (const Nimble::Matrix4 &m) |
| Multiply the top matrix from the right with the given matrix and push the result into the stack. | |
| void | pushTransformRightMul (const Nimble::Matrix3 &m) |
| void | resetTransform () |
| Clears the stack so it only contains an identity matrix. | |
| void | rightMul (const Nimble::Matrix4 &m) |
| Multiply the top matrix from the right with the given matrix The end result is equivalent to: More... | |
| void | setTransform (const Nimble::Matrix4 &m) |
| Replaces the top matrix with the given matrix. More... | |
| size_t | stackSize () const |
| Get the size of the transform stack. More... | |
| const Nimble::Matrix4 & | transform () const |
| Get the top matrix of the stack. | |
| Nimble::Matrix3 | transform3 () const |
| Get the top matrix of the stack as 3x3-matrix. | |
| Transformer () | |
| Creates an empty transformation stack. | |
| Nimble::Vector2 | unproject (const Nimble::Vector2 &) const |
| Apply inverse of the current transformation matrix on a 2D vector. | |
| virtual | ~Transformer () |
| Deletes the transformation stack. | |
Protected Member Functions | |
| virtual void | beforeTransformChange () |
| This function gets called just before the transformation matrix is changed. More... | |
Protected Attributes | |
|
std::stack< Nimble::Matrix4, std::vector< Nimble::Matrix4 > > | m_stack |
| The transformation stack. | |
Geometrical 3D transformation stack.
This class encapsulates 3D transformation stack. The transformations are stored as 4x4 matrices.
|
protectedvirtual |
This function gets called just before the transformation matrix is changed.
Reimplemented in Luminous::RenderContext.
| void Luminous::Transformer::leftMul | ( | const Nimble::Matrix4 & | m | ) |
Multiply the top matrix from the left with the given matrix The end result is equivalent to:
| m | matrix to multiply with |
| void Luminous::Transformer::pushTransform | ( | const Nimble::Matrix4 & | m | ) |
Push the given matrix to the stack pushTransform(m) has the same effect as:
| m | matrix to push |
| void Luminous::Transformer::pushTransform | ( | const Nimble::Matrix3 & | m | ) |
| void Luminous::Transformer::pushTransformLeftMul | ( | const Nimble::Matrix3 & | m | ) |
| void Luminous::Transformer::pushTransformRightMul | ( | const Nimble::Matrix3 & | m | ) |
| void Luminous::Transformer::rightMul | ( | const Nimble::Matrix4 & | m | ) |
Multiply the top matrix from the right with the given matrix The end result is equivalent to:
| m | matrix to multiply with |
| void Luminous::Transformer::setTransform | ( | const Nimble::Matrix4 & | m | ) |
Replaces the top matrix with the given matrix.
| m | matrix to set |
|
inline |
Get the size of the transform stack.