From 843a4db650110ac242e2e6a2c70b4dfd4dcc97c0 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 3 Jul 2014 13:50:27 -0700 Subject: [PATCH] rotation offset for hydra controllers --- interface/src/devices/SixenseManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interface/src/devices/SixenseManager.cpp b/interface/src/devices/SixenseManager.cpp index 1b7baf2ee1..b0e49013b3 100644 --- a/interface/src/devices/SixenseManager.cpp +++ b/interface/src/devices/SixenseManager.cpp @@ -154,6 +154,11 @@ void SixenseManager::update(float deltaTime) { // no latency. float velocityFilter = glm::clamp(1.0f - glm::length(rawVelocity), 0.0f, 1.0f); palm->setRawPosition(palm->getRawPosition() * velocityFilter + position * (1.0f - velocityFilter)); + + // adjustment for hydra controllers fit into hands + float sign = (i == 0) ? -1.0f : 1.0f; + rotation *= glm::angleAxis(sign * PI/4.0f, glm::vec3(0.0f, 0.0f, 1.0f)); + palm->setRawRotation(safeMix(palm->getRawRotation(), rotation, 1.0f - velocityFilter)); // use the velocity to determine whether there's any movement (if the hand isn't new)