mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 19:04:32 +02:00
Merge pull request #719 from machinelevel/dev4
Minor tweaks to Rave Glove mode, per Ryan's testing
This commit is contained in:
commit
4ce2a8a675
2 changed files with 13 additions and 5 deletions
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue