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

Three-dimensional transformation implemented using dual quaternions.

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

Base classes

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

Public types

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

Public functions

auto transformation() const -> Math::DualQuaternion<T>
Object transformation.
auto setTransformation(const Math::DualQuaternion<T>& transformation) -> Object<BasicDualQuaternionTransformation<T>>&
Set transformation.
auto resetTransformation() -> Object<BasicDualQuaternionTransformation<T>>&
Reset object transformation.
auto normalizeRotation() -> Object<BasicDualQuaternionTransformation<T>>&
Normalize rotation part.
auto transform(const Math::DualQuaternion<T>& transformation) -> Object<BasicDualQuaternionTransformation<T>>&
Transform the object.
auto transformLocal(const Math::DualQuaternion<T>& transformation) -> Object<BasicDualQuaternionTransformation<T>>&
Transform the object as a local transformation.
auto translate(const Math::Vector3<T>& vector) -> Object<BasicDualQuaternionTransformation<T>>&
Translate the object.
auto translateLocal(const Math::Vector3<T>& vector) -> Object<BasicDualQuaternionTransformation<T>>&
Translate the object as a local transformation.
auto rotate(const Math::Quaternion<T>& quaternion) -> Object<BasicDualQuaternionTransformation<T>>& new in 2020.06
Rotate the object using a quaternion.
auto rotateLocal(const Math::Quaternion<T>& quaternion) -> Object<BasicDualQuaternionTransformation<T>>& new in 2020.06
Rotate the object using a quaternion as a local transformation.
auto rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis) -> Object<BasicDualQuaternionTransformation<T>>&
Rotate the object.
auto rotateLocal(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis) -> Object<BasicDualQuaternionTransformation<T>>&
Rotate the object as a local transformation.

Function documentation

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

Set transformation.

Returns Reference to self (for method chaining)

Expects that the dual quaternion is normalized.

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

Reset object transformation.

Returns Reference to self (for method chaining)

template<class T>
Object<BasicDualQuaternionTransformation<T>>& Magnum::SceneGraph::BasicDualQuaternionTransformation<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<BasicDualQuaternionTransformation<T>>& Magnum::SceneGraph::BasicDualQuaternionTransformation<T>::transform(const Math::DualQuaternion<T>& transformation)

Transform the object.

Returns Reference to self (for method chaining)

Expects that the dual quaternion is normalized.

template<class T>
Object<BasicDualQuaternionTransformation<T>>& Magnum::SceneGraph::BasicDualQuaternionTransformation<T>::transformLocal(const Math::DualQuaternion<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<BasicDualQuaternionTransformation<T>>& Magnum::SceneGraph::BasicDualQuaternionTransformation<T>::translate(const Math::Vector3<T>& vector)

Translate the object.

Returns Reference to self (for method chaining)

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

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

Translate the object as a local transformation.

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

template<class T>
Object<BasicDualQuaternionTransformation<T>>& Magnum::SceneGraph::BasicDualQuaternionTransformation<T>::rotate(const Math::Quaternion<T>& quaternion) new in 2020.06

Rotate the object using a quaternion.

Parameters
quaternion Normalized quaternion
Returns Reference to self (for method chaining)

Same as calling transform() with quaternion. Expects that the quaternion is normalized.

template<class T>
Object<BasicDualQuaternionTransformation<T>>& Magnum::SceneGraph::BasicDualQuaternionTransformation<T>::rotateLocal(const Math::Quaternion<T>& quaternion) new in 2020.06

Rotate the object using a quaternion as a local transformation.

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

template<class T>
Object<BasicDualQuaternionTransformation<T>>& Magnum::SceneGraph::BasicDualQuaternionTransformation<T>::rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis)

Rotate the object.

Parameters
angle Angle (counterclockwise)
normalizedAxis Normalized rotation axis
Returns Reference to self (for method chaining)

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

template<class T>
Object<BasicDualQuaternionTransformation<T>>& Magnum::SceneGraph::BasicDualQuaternionTransformation<T>::rotateLocal(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis)

Rotate the object as a local transformation.

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