template<class T>
BasicDualComplexTransformation class
Two-dimensional transformation implemented using dual complex numbers.
This class allows only rigid transformation (i.e. only rotation and translation). Uses Math::
Base classes
-
template<class T>class AbstractBasicTranslationRotation2D<T>
- 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 the object.
-
auto transformLocal(const Math::
DualComplex<T>& transformation) -> Object<BasicDualComplexTransformation<T>>& - Transform the object as a local transformation.
-
auto translate(const Math::
Vector2<T>& vector) -> Object<BasicDualComplexTransformation<T>>& - Translate the object.
-
auto translateLocal(const Math::
Vector2<T>& vector) -> Object<BasicDualComplexTransformation<T>>& - Translate the object as a local transformation.
-
auto rotate(const Math::
Complex<T>& complex) -> Object<BasicDualComplexTransformation<T>>& new in 2020.06 - Rotate the object using a complex number.
-
auto rotateLocal(const Math::
Complex<T>& complex) -> Object<BasicDualComplexTransformation<T>>& new in 2020.06 - Rotate the object using a complex number as a local transformation.
-
auto rotate(Math::
Rad<T> angle) -> Object<BasicDualComplexTransformation<T>>& - Rotate the object.
-
auto rotateLocal(Math::
Rad<T> angle) -> Object<BasicDualComplexTransformation<T>>& - Rotate the object as a local transformation.
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 the 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 the 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 the object.
Returns | Reference to self (for method chaining) |
---|
Same as calling transform() with Math::
template<class T>
Object<BasicDualComplexTransformation<T>>& Magnum:: SceneGraph:: BasicDualComplexTransformation<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::
template<class T>
Object<BasicDualComplexTransformation<T>>& Magnum:: SceneGraph:: BasicDualComplexTransformation<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) |
Same as calling transform() with complex
. Expects that the complex number is normalized.
template<class T>
Object<BasicDualComplexTransformation<T>>& Magnum:: SceneGraph:: BasicDualComplexTransformation<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<BasicDualComplexTransformation<T>>& Magnum:: SceneGraph:: BasicDualComplexTransformation<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::
template<class T>
Object<BasicDualComplexTransformation<T>>& Magnum:: SceneGraph:: BasicDualComplexTransformation<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.