mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 04:03:59 +02:00
only active sixsense palms
This commit is contained in:
parent
218ae9c9d8
commit
89e499a78f
1 changed files with 8 additions and 5 deletions
|
@ -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<PalmData>::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);
|
||||
|
|
Loading…
Reference in a new issue