template<class T>
BasicDualQuaternionTransformation class
Three-dimensional transformation implemented using dual quaternions.
Contents
This class allows only rigid transformation (i.e. only rotation and translation). Uses Math::
Base classes
-
template<class T>class AbstractBasicTranslationRotation3D
- 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 object.
-
auto transformLocal(const Math::
DualQuaternion<T>& transformation) -> Object<BasicDualQuaternionTransformation<T>>& - Transform object as a local transformation.
-
auto translate(const Math::
Vector3<T>& vector) -> Object<BasicDualQuaternionTransformation<T>>& - Translate object.
-
auto translateLocal(const Math::
Vector3<T>& vector) -> Object<BasicDualQuaternionTransformation<T>>& - Translate object as a local transformation.
-
auto rotate(Math::
Rad<T> angle, const Math:: Vector3<T>& normalizedAxis) -> Object<BasicDualQuaternionTransformation<T>>& - Rotate object.
-
auto rotateLocal(Math::
Rad<T> angle, const Math:: Vector3<T>& normalizedAxis) -> Object<BasicDualQuaternionTransformation<T>>& - Rotate object as a local transformation.
Private functions
- void doResetTransformation() override final virtual
- Polymorphic implementation for resetTransformation()
-
void doRotate(Math::
Rad<T> angle, const Math:: Vector3<T>& normalizedAxis) override final virtual - Polymorphic implementation for rotate()
-
void doRotateLocal(Math::
Rad<T> angle, const Math:: Vector3<T>& normalizedAxis) override final virtual - Polymorphic implementation for rotateLocal()
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 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 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 object.
Returns | Reference to self (for method chaining) |
---|
Same as calling transform() with Math::
template<class T>
Object<BasicDualQuaternionTransformation<T>>& Magnum:: SceneGraph:: BasicDualQuaternionTransformation<T>:: translateLocal(const Math:: Vector3<T>& vector)
Translate 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(Math:: Rad<T> angle,
const Math:: Vector3<T>& normalizedAxis)
Rotate object.
Parameters | |
---|---|
angle | Angle (counterclockwise) |
normalizedAxis | Normalized rotation axis |
Returns | Reference to self (for method chaining) |
Same as calling transform() with Math::
template<class T>
Object<BasicDualQuaternionTransformation<T>>& Magnum:: SceneGraph:: BasicDualQuaternionTransformation<T>:: rotateLocal(Math:: Rad<T> angle,
const Math:: Vector3<T>& normalizedAxis)
Rotate object as a local transformation.
Similar to the above, except that the transformation is applied before all others.