mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:24:00 +02:00
fix return to default pose after hydra disconnect
This commit is contained in:
parent
843a4db650
commit
0f7859bf83
1 changed files with 9 additions and 8 deletions
|
@ -71,6 +71,15 @@ void SixenseManager::setFilter(bool filter) {
|
|||
|
||||
void SixenseManager::update(float deltaTime) {
|
||||
#ifdef HAVE_SIXENSE
|
||||
// if the controllers haven't been moved in a while, disable
|
||||
const unsigned int MOVEMENT_DISABLE_SECONDS = 3;
|
||||
if (usecTimestampNow() - _lastMovement > (MOVEMENT_DISABLE_SECONDS * USECS_PER_SECOND)) {
|
||||
Hand* hand = Application::getInstance()->getAvatar()->getHand();
|
||||
for (std::vector<PalmData>::iterator it = hand->getPalms().begin(); it != hand->getPalms().end(); it++) {
|
||||
it->setActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (sixenseGetNumActiveControllers() == 0) {
|
||||
_hydrasConnected = false;
|
||||
return;
|
||||
|
@ -185,14 +194,6 @@ void SixenseManager::update(float deltaTime) {
|
|||
if (numActiveControllers == 2) {
|
||||
updateCalibration(controllers);
|
||||
}
|
||||
|
||||
// if the controllers haven't been moved in a while, disable
|
||||
const unsigned int MOVEMENT_DISABLE_SECONDS = 3;
|
||||
if (usecTimestampNow() - _lastMovement > (MOVEMENT_DISABLE_SECONDS * USECS_PER_SECOND)) {
|
||||
for (std::vector<PalmData>::iterator it = hand->getPalms().begin(); it != hand->getPalms().end(); it++) {
|
||||
it->setActive(false);
|
||||
}
|
||||
}
|
||||
#endif // HAVE_SIXENSE
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue