From 942ef17787680d3a9f3ce39822de6f3e37c0ed5b Mon Sep 17 00:00:00 2001 From: Christian Mattes <christian.mattes@rwth-aachen.de> Date: Thu, 7 Mar 2019 14:55:25 +0100 Subject: [PATCH] Made enabling/disabling zoom/rotation easier in RopeLocomotion --- src/lava-vr/RopeLocomotion.cc | 4 +++- src/lava-vr/RopeLocomotion.hh | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lava-vr/RopeLocomotion.cc b/src/lava-vr/RopeLocomotion.cc index c392b66..b5d107c 100644 --- a/src/lava-vr/RopeLocomotion.cc +++ b/src/lava-vr/RopeLocomotion.cc @@ -64,7 +64,9 @@ glm::mat4 RopeLocomotion::updateMatrix(glm::mat4 old) { : 1.0f; auto axis = glm::vec3{0.f, 1.f, 0.f}; - auto angle = glm::orientedAngle(old_dir, new_dir, axis); + auto angle = (mConfig.allowRotation) + ? glm::orientedAngle(old_dir, new_dir, axis) + : 0.0f; auto rot = glm::rotate(angle, axis); auto combined = glm::translate(new_cog) * rot * diff --git a/src/lava-vr/RopeLocomotion.hh b/src/lava-vr/RopeLocomotion.hh index 08a739e..53a4661 100644 --- a/src/lava-vr/RopeLocomotion.hh +++ b/src/lava-vr/RopeLocomotion.hh @@ -10,7 +10,8 @@ namespace vr { class RopeLocomotion { public: struct Config { - bool allowZoom; + bool allowZoom = true; + bool allowRotation = true; }; RopeLocomotion(lava::openvr::SharedOpenVRHmd const &output); -- GitLab