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

Two-dimensional rigid transformation implemented using matrices.

Unlike BasicMatrixTransformation2D this class allows only rotation, reflection and translation (no scaling or setting arbitrary transformations). This allows to use Math::Matrix3::invertedRigid() for faster computation of inverse transformations.

Base classes

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

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<BasicRigidMatrixTransformation2D<T>>&
Set transformation.
auto resetTransformation() -> Object<BasicRigidMatrixTransformation2D<T>>&
Reset object transformation.
auto normalizeRotation() -> Object<BasicRigidMatrixTransformation2D<T>>&
Normalize rotation part.
auto transform(const Math::Matrix3<T>& transformation) -> Object<BasicRigidMatrixTransformation2D<T>>&
Transform the object.
auto transformLocal(const Math::Matrix3<T>& transformation) -> Object<BasicRigidMatrixTransformation2D<T>>&
Transform the object as a local transformation.
auto translate(const Math::Vector2<T>& vector) -> Object<BasicRigidMatrixTransformation2D<T>>&
Translate the object.
auto translateLocal(const Math::Vector2<T>& vector) -> Object<BasicRigidMatrixTransformation2D<T>>&
Translate the object as a local transformation.
auto rotate(const Math::Complex<T>& complex) -> Object<BasicRigidMatrixTransformation2D<T>>& new in 2020.06
Rotate the object using a complex number.
auto rotateLocal(const Math::Complex<T>& complex) -> Object<BasicRigidMatrixTransformation2D<T>>& new in 2020.06
Rotate the object using a complex number as a local transformation.
auto rotate(Math::Rad<T> angle) -> Object<BasicRigidMatrixTransformation2D<T>>&
Rotate the object.
auto rotateLocal(Math::Rad<T> angle) -> Object<BasicRigidMatrixTransformation2D<T>>&
Rotate the object as a local transformation.
auto reflect(const Math::Vector2<T>& normal) -> Object<BasicRigidMatrixTransformation2D<T>>&
Reflect the object.
auto reflectLocal(const Math::Vector2<T>& normal) -> Object<BasicRigidMatrixTransformation2D<T>>&
Reflect the object as a local transformation.

Function documentation

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

Set transformation.

Returns Reference to self (for method chaining)

Expects that the matrix represents rigid transformation.

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

Reset object transformation.

Returns Reference to self (for method chaining)

template<class T>
Object<BasicRigidMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation2D<T>::normalizeRotation()

Normalize rotation part.

Returns Reference to self (for method chaining)

Normalizes the rotation part using Math::Algorithms::gramSchmidtOrthonormalize() to prevent rounding errors when rotating the object subsequently.

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

Transform the object.

Returns Reference to self (for method chaining)

Expects that the matrix represents rigid transformation.

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

Transform the object as a local transformation.

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

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

Translate the object.

Returns Reference to self (for method chaining)

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

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

Translate the 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<BasicRigidMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation2D<T>::rotate(const Math::Complex<T>& complex) new in 2020.06

Rotate the object using a complex number.

Parameters
complex Normalized complex number
Returns Reference to self (for method chaining)

Expects that the complex number is normalized.

template<class T>
Object<BasicRigidMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation2D<T>::rotateLocal(const Math::Complex<T>& complex) new in 2020.06

Rotate the object using a complex number as a local transformation.

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

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

Rotate the object.

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

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

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

Rotate the 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<BasicRigidMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation2D<T>::reflect(const Math::Vector2<T>& normal)

Reflect the 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<BasicRigidMatrixTransformation2D<T>>& Magnum::SceneGraph::BasicRigidMatrixTransformation2D<T>::reflectLocal(const Math::Vector2<T>& normal)

Reflect the 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().