From fe3a73aab29bf6d1c9743300bbf6940a1fc2f753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Mar 2013 13:28:44 +0100 Subject: [PATCH] SceneGraph: add DualQuaternionTransformation::rotate[XYZ]() overloads. They only pass the arguments to original implementation but return proper type to avoid weird issues with different method chaining order. --- src/SceneGraph/DualQuaternionTransformation.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/SceneGraph/DualQuaternionTransformation.h b/src/SceneGraph/DualQuaternionTransformation.h index 4245749c6..811450d19 100644 --- a/src/SceneGraph/DualQuaternionTransformation.h +++ b/src/SceneGraph/DualQuaternionTransformation.h @@ -148,6 +148,22 @@ class DualQuaternionTransformation: public AbstractTranslationRotation3D { return this; } + /* Overloads to remove WTF-factor from method chaining order */ + #ifndef DOXYGEN_GENERATING_OUTPUT + inline DualQuaternionTransformation* rotateX(Math::Rad angle, TransformationType type = TransformationType::Global) override { + AbstractTranslationRotation3D::rotateX(angle, type); + return this; + } + inline DualQuaternionTransformation* rotateY(Math::Rad angle, TransformationType type = TransformationType::Global) override { + AbstractTranslationRotation3D::rotateY(angle, type); + return this; + } + inline DualQuaternionTransformation* rotateZ(Math::Rad angle, TransformationType type = TransformationType::Global) override { + AbstractTranslationRotation3D::rotateZ(angle, type); + return this; + } + #endif + protected: /* Allow construction only from Object */ inline explicit DualQuaternionTransformation() = default;