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:
Eric Johnston 2013-07-22 07:19:25 -07:00
parent 84328057ba
commit 9ab8fecff5
2 changed files with 13 additions and 5 deletions

View file

@ -12,6 +12,9 @@
#include <dlfcn.h> // needed for RTLD_LAZY
#include <sstream>
// Uncomment the next line to use Leap-smoothed stabilized (slower) data.
//#define USE_STABILIZED_DATA
bool LeapManager::_libraryExists = false;
bool LeapManager::_doFakeFingers = false;
Leap::Controller* LeapManager::_controller = NULL;
@ -175,7 +178,11 @@ void LeapManager::nextFrame(Avatar& avatar) {
finger.resetFramesWithoutData();
finger.setLeapID(leapFinger.id());
finger.setActive(true);
#ifdef USE_STABILIZED_DATA
const Leap::Vector tip = leapFinger.stabilizedTipPosition();
#else
const Leap::Vector tip = leapFinger.tipPosition();
#endif
const Leap::Vector root = tip - leapFinger.direction() * leapFinger.length();
finger.setRawTipPosition(glm::vec3(tip.x, tip.y, tip.z));
finger.setRawRootPosition(glm::vec3(root.x, root.y, root.z));

View file

@ -830,13 +830,14 @@ void Avatar::updateHandMovementAndTouching(float deltaTime, bool enableHandMovem
}
// If there's a leap-interaction hand visible, use that as the endpoint
for (size_t i = 0; i < getHand().getPalms().size(); ++i) {
PalmData& palm = getHand().getPalms()[i];
if (palm.isActive()) {
_skeleton.joint[ AVATAR_JOINT_RIGHT_FINGERTIPS ].position = palm.getPosition();
if (!getHand().isRaveGloveActive()) {
for (size_t i = 0; i < getHand().getPalms().size(); ++i) {
PalmData& palm = getHand().getPalms()[i];
if (palm.isActive()) {
_skeleton.joint[ AVATAR_JOINT_RIGHT_FINGERTIPS ].position = palm.getPosition();
}
}
}
}//if (_isMine)
//constrain right arm length and re-adjust elbow position as it bends