From 89e499a78fde32d2e9e54f801b5d838463a5601b Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Sun, 4 Jan 2015 12:26:30 -0800 Subject: [PATCH] only active sixsense palms --- interface/src/devices/SixenseManager.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/interface/src/devices/SixenseManager.cpp b/interface/src/devices/SixenseManager.cpp index 5fb4a71091..ea37469e8d 100644 --- a/interface/src/devices/SixenseManager.cpp +++ b/interface/src/devices/SixenseManager.cpp @@ -146,11 +146,6 @@ void SixenseManager::update(float deltaTime) { #ifdef HAVE_SIXENSE Hand* hand = Application::getInstance()->getAvatar()->getHand(); if (_isInitialized && _isEnabled) { - // Disable the hands (and return to default pose) if both controllers are at base station - for (std::vector::iterator it = hand->getPalms().begin(); it != hand->getPalms().end(); it++) { - it->setActive(!_controllersAtBase); - } - #ifdef __APPLE__ SixenseBaseFunction sixenseGetNumActiveControllers = (SixenseBaseFunction) _sixenseLibrary->resolve("sixenseGetNumActiveControllers"); @@ -213,6 +208,14 @@ void SixenseManager::update(float deltaTime) { qDebug("Found new Sixense controller, ID %i", data->controller_index); } + // Disable the hands (and return to default pose) if both controllers are at base station + if (foundHand) { + palm->setActive(!_controllersAtBase); + } else { + palm->setActive(false); // if this isn't a Sixsense ID palm, always make it inactive + } + + // Read controller buttons and joystick into the hand palm->setControllerButtons(data->buttons); palm->setTrigger(data->trigger);