mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-10 20:47:22 +02:00
Minor tweaks to Rave Glove mode, per Ryan's testing
1. Improve response by using unfiltered data from Leap library 2. Reduce distracting arm-flail by only attaching the arm to che glove when we're not in rave mode.
This commit is contained in:
parent
84328057ba
commit
9ab8fecff5
2 changed files with 13 additions and 5 deletions
|
@ -12,6 +12,9 @@
|
||||||
#include <dlfcn.h> // needed for RTLD_LAZY
|
#include <dlfcn.h> // needed for RTLD_LAZY
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
// Uncomment the next line to use Leap-smoothed stabilized (slower) data.
|
||||||
|
//#define USE_STABILIZED_DATA
|
||||||
|
|
||||||
bool LeapManager::_libraryExists = false;
|
bool LeapManager::_libraryExists = false;
|
||||||
bool LeapManager::_doFakeFingers = false;
|
bool LeapManager::_doFakeFingers = false;
|
||||||
Leap::Controller* LeapManager::_controller = NULL;
|
Leap::Controller* LeapManager::_controller = NULL;
|
||||||
|
@ -175,7 +178,11 @@ void LeapManager::nextFrame(Avatar& avatar) {
|
||||||
finger.resetFramesWithoutData();
|
finger.resetFramesWithoutData();
|
||||||
finger.setLeapID(leapFinger.id());
|
finger.setLeapID(leapFinger.id());
|
||||||
finger.setActive(true);
|
finger.setActive(true);
|
||||||
|
#ifdef USE_STABILIZED_DATA
|
||||||
const Leap::Vector tip = leapFinger.stabilizedTipPosition();
|
const Leap::Vector tip = leapFinger.stabilizedTipPosition();
|
||||||
|
#else
|
||||||
|
const Leap::Vector tip = leapFinger.tipPosition();
|
||||||
|
#endif
|
||||||
const Leap::Vector root = tip - leapFinger.direction() * leapFinger.length();
|
const Leap::Vector root = tip - leapFinger.direction() * leapFinger.length();
|
||||||
finger.setRawTipPosition(glm::vec3(tip.x, tip.y, tip.z));
|
finger.setRawTipPosition(glm::vec3(tip.x, tip.y, tip.z));
|
||||||
finger.setRawRootPosition(glm::vec3(root.x, root.y, root.z));
|
finger.setRawRootPosition(glm::vec3(root.x, root.y, root.z));
|
||||||
|
|
|
@ -830,13 +830,14 @@ void Avatar::updateHandMovementAndTouching(float deltaTime, bool enableHandMovem
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there's a leap-interaction hand visible, use that as the endpoint
|
// If there's a leap-interaction hand visible, use that as the endpoint
|
||||||
for (size_t i = 0; i < getHand().getPalms().size(); ++i) {
|
if (!getHand().isRaveGloveActive()) {
|
||||||
PalmData& palm = getHand().getPalms()[i];
|
for (size_t i = 0; i < getHand().getPalms().size(); ++i) {
|
||||||
if (palm.isActive()) {
|
PalmData& palm = getHand().getPalms()[i];
|
||||||
_skeleton.joint[ AVATAR_JOINT_RIGHT_FINGERTIPS ].position = palm.getPosition();
|
if (palm.isActive()) {
|
||||||
|
_skeleton.joint[ AVATAR_JOINT_RIGHT_FINGERTIPS ].position = palm.getPosition();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}//if (_isMine)
|
}//if (_isMine)
|
||||||
|
|
||||||
//constrain right arm length and re-adjust elbow position as it bends
|
//constrain right arm length and re-adjust elbow position as it bends
|
||||||
|
|
Loading…
Reference in a new issue