template<class T>
Magnum::SceneGraph::BasicMatrixTransformation2D class

Two-dimensional transformation implemented using matrices.

Uses Math::Matrix3 as underlying transformation type.

Base classes

template<class T>
class AbstractBasicTranslationRotationScaling2D
Base transformation for two-dimensional scenes supporting translation, rotation and scaling.

Public types

using DataType = Math::Matrix3<T>
Underlying transformation type.

Public functions

auto transformation() const -> Math::Matrix3<T>
Object transformation.
auto setTransformation(const Math::Matrix3<T>& transformation) -> Object<BasicMatrixTransformation2D<T>>&
Set transformation.
auto transform(const Math::Matrix3<T>& transformation) -> Object<BasicMatrixTransformation2D<T>>&
Transform object.
auto transformLocal(const Math::Matrix3<T>& transformation) -> Object<BasicMatrixTransformation2D<T>>&
Transform object as a local transformation.
auto resetTransformation() -> Object<BasicMatrixTransformation2D<T>>&
Reset object transformation.
auto translate(const Math::Vector2<T>& vector) -> Object<BasicMatrixTransformation2D<T>>&
auto translateLocal(const Math::Vector2<T>& vector) -> Object<BasicMatrixTransformation2D<T>>&
Translate object as a local transformation.
auto rotate(Math::Rad<T> angle) -> Object<BasicMatrixTransformation2D<T>>&
Rotate object.
auto rotateLocal(Math::Rad<T> angle) -> Object<BasicMatrixTransformation2D<T>>&
Rotate object as a local transformation.
auto scale(const Math::Vector2<T>& vector) -> Object<BasicMatrixTransformation2D<T>>&
Scale object.
auto scaleLocal(const Math::Vector2<T>& vector) -> Object<BasicMatrixTransformation2D<T>>&
Scale object as a local transformation.
auto reflect(const Math::Vector2<T>& normal) -> Object<BasicMatrixTransformation2D<T>>&
Reflect object.
auto reflectLocal(const Math::Vector2<T>& normal) -> Object<BasicMatrixTransformation2D<T>>&
Reflect object as a local transformation.

Private functions

void doResetTransformation() override final virtual
Polymorphic implementation for resetTransformation()
void doRotate(Math::Rad<T> angle) override final virtual
Polymorphic implementation for rotate()
void doRotateLocal(Math::Rad<T> angle) override final virtual
Polymorphic implementation for rotateLocal()
void doScale(const Math::Vector2<T>& vector) override final virtual
Polymorphic implementation for scale()
void doScaleLocal(const Math::Vector2<T>& vector) override final virtual
Polymorphic implementation for scaleLocal()

Function documentation

template<class T>
Object<BasicMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicMatrixTransformation2D<T>::setTransformation(const Math::Matrix3<T>& transformation)

Set transformation.

Returns Reference to self (for method chaining)

template<class T>
Object<BasicMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicMatrixTransformation2D<T>::transform(const Math::Matrix3<T>& transformation)

Transform object.

Returns Reference to self (for method chaining)

template<class T>
Object<BasicMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicMatrixTransformation2D<T>::transformLocal(const Math::Matrix3<T>& transformation)

Transform object as a local transformation.

Similar to the above, except that the transformation is applied before all others.

template<class T>
Object<BasicMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicMatrixTransformation2D<T>::resetTransformation()

Reset object transformation.

Returns Reference to self (for method chaining)

template<class T>
Object<BasicMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicMatrixTransformation2D<T>::translate(const Math::Vector2<T>& vector)

Returns Reference to self (for method chaining)

Translate object Same as calling transform() with Math::Matrix3::translation().

template<class T>
Object<BasicMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicMatrixTransformation2D<T>::translateLocal(const Math::Vector2<T>& vector)

Translate object as a local transformation.

Similar to the above, except that the transformation is applied before all others. Same as calling transformLocal() with Math::Matrix3::translation().

template<class T>
Object<BasicMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicMatrixTransformation2D<T>::rotate(Math::Rad<T> angle)

Rotate object.

Parameters
angle Angle (counterclockwise)
Returns Reference to self (for method chaining)

Same as calling transform() with Math::Matrix3::rotation().

template<class T>
Object<BasicMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicMatrixTransformation2D<T>::rotateLocal(Math::Rad<T> angle)

Rotate object as a local transformation.

Similar to the above, except that the transformation is applied before all others. Same as calling transformLocal() with Math::Matrix3::rotation().

template<class T>
Object<BasicMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicMatrixTransformation2D<T>::scale(const Math::Vector2<T>& vector)

Scale object.

Returns Reference to self (for method chaining)

Same as calling transform() with Math::Matrix3::scaling().

template<class T>
Object<BasicMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicMatrixTransformation2D<T>::scaleLocal(const Math::Vector2<T>& vector)

Scale object as a local transformation.

Similar to the above, except that the transformation is applied before all others. Same as calling transformLocal() with Math::Matrix3::scaling().

template<class T>
Object<BasicMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicMatrixTransformation2D<T>::reflect(const Math::Vector2<T>& normal)

Reflect object.

Parameters
normal Normal of the line through which to reflect (normalized)
Returns Reference to self (for method chaining)

Same as calling transform() with Math::Matrix3::reflection().

template<class T>
Object<BasicMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicMatrixTransformation2D<T>::reflectLocal(const Math::Vector2<T>& normal)

Reflect object as a local transformation.

Similar to the above, except that the transformation is applied before all others. Same as calling transformLocal() with Math::Matrix3::reflection().