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

Two-dimensional transformation implemented using dual complex numbers.

This class allows only rigid transformation (i.e. only rotation and translation). Uses Math::DualComplex as underlying transformation type.

Base classes

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

Public types

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

Public functions

auto transformation() const -> Math::DualComplex<T>
Object transformation.
auto setTransformation(const Math::DualComplex<T>& transformation) -> Object<BasicDualComplexTransformation<T>>&
Set transformation.
auto resetTransformation() -> Object<BasicDualComplexTransformation<T>>&
Reset object transformation.
auto normalizeRotation() -> Object<BasicDualComplexTransformation<T>>&
Normalize rotation part.
auto transform(const Math::DualComplex<T>& transformation) -> Object<BasicDualComplexTransformation<T>>&
Transform object.
auto transformLocal(const Math::DualComplex<T>& transformation) -> Object<BasicDualComplexTransformation<T>>&
Transform object as a local transformation.
auto translate(const Math::Vector2<T>& vector) -> Object<BasicDualComplexTransformation<T>>&
Translate object.
auto translateLocal(const Math::Vector2<T>& vector) -> Object<BasicDualComplexTransformation<T>>&
Translate object as a local transformation.
auto rotate(Math::Rad<T> angle) -> Object<BasicDualComplexTransformation<T>>&
Rotate object.
auto rotateLocal(Math::Rad<T> angle) -> Object<BasicDualComplexTransformation<T>>&
Rotate 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()

Function documentation

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

Set transformation.

Returns Reference to self (for method chaining)

Expects that the dual complex number is normalized.

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

Reset object transformation.

Returns Reference to self (for method chaining)

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

Normalize rotation part.

Returns Reference to self (for method chaining)

Normalizes the rotation part to prevent rounding errors when rotating the object subsequently.

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

Transform object.

Returns Reference to self (for method chaining)

Expects that the dual complex number is normalized.

template<class T>
Object<BasicDualComplexTransformation<T>>& Magnum::SceneGraph::BasicDualComplexTransformation<T>::transformLocal(const Math::DualComplex<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<BasicDualComplexTransformation<T>>& Magnum::SceneGraph::BasicDualComplexTransformation<T>::translate(const Math::Vector2<T>& vector)

Translate object.

Returns Reference to self (for method chaining)

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

template<class T>
Object<BasicDualComplexTransformation<T>>& Magnum::SceneGraph::BasicDualComplexTransformation<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::DualComplex::translation().

template<class T>
Object<BasicDualComplexTransformation<T>>& Magnum::SceneGraph::BasicDualComplexTransformation<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::DualComplex::rotation().

template<class T>
Object<BasicDualComplexTransformation<T>>& Magnum::SceneGraph::BasicDualComplexTransformation<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.