mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 12:04:03 +02:00
Merge pull request #657 from machinelevel/dev4
Some Leap finger fixes, but also temporarily disable Leap data sending, ...
This commit is contained in:
commit
7c60fd4327
2 changed files with 13 additions and 3 deletions
|
@ -54,7 +54,7 @@ void Hand::calculateGeometry() {
|
||||||
_position = head.getPosition() + head.getOrientation() * offset;
|
_position = head.getPosition() + head.getOrientation() * offset;
|
||||||
_orientation = head.getOrientation();
|
_orientation = head.getOrientation();
|
||||||
|
|
||||||
int numLeapBalls = _fingerTips.size() + _fingerRoots.size();
|
int numLeapBalls = _fingerTips.size();
|
||||||
_leapBalls.resize(numLeapBalls);
|
_leapBalls.resize(numLeapBalls);
|
||||||
|
|
||||||
for (int i = 0; i < _fingerTips.size(); ++i) {
|
for (int i = 0; i < _fingerTips.size(); ++i) {
|
||||||
|
|
|
@ -137,6 +137,11 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
||||||
if (numFingerVectors > 255)
|
if (numFingerVectors > 255)
|
||||||
numFingerVectors = 0; // safety. We shouldn't ever get over 255, so consider that invalid.
|
numFingerVectors = 0; // safety. We shouldn't ever get over 255, so consider that invalid.
|
||||||
|
|
||||||
|
/////////////////////////////////
|
||||||
|
// Temporarily disable Leap finger sending, as it's causing a crash whenever someone's got a Leap connected
|
||||||
|
numFingerVectors = 0;
|
||||||
|
/////////////////////////////////
|
||||||
|
|
||||||
*destinationBuffer++ = (unsigned char)numFingerVectors;
|
*destinationBuffer++ = (unsigned char)numFingerVectors;
|
||||||
|
|
||||||
if (numFingerVectors > 0) {
|
if (numFingerVectors > 0) {
|
||||||
|
@ -255,8 +260,8 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
|
||||||
// leap hand data
|
// leap hand data
|
||||||
if (sourceBuffer - startPosition < numBytes) // safety check
|
if (sourceBuffer - startPosition < numBytes) // safety check
|
||||||
{
|
{
|
||||||
std::vector<glm::vec3> fingerTips = _handData->getFingerTips();
|
std::vector<glm::vec3> fingerTips;
|
||||||
std::vector<glm::vec3> fingerRoots = _handData->getFingerRoots();
|
std::vector<glm::vec3> fingerRoots;
|
||||||
unsigned int numFingerVectors = *sourceBuffer++;
|
unsigned int numFingerVectors = *sourceBuffer++;
|
||||||
unsigned int numFingerTips = numFingerVectors / 2;
|
unsigned int numFingerTips = numFingerVectors / 2;
|
||||||
unsigned int numFingerRoots = numFingerVectors - numFingerTips;
|
unsigned int numFingerRoots = numFingerVectors - numFingerTips;
|
||||||
|
@ -267,6 +272,11 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
|
||||||
sourceBuffer += unpackFloatScalarFromSignedTwoByteFixed((int16_t*) sourceBuffer, &(fingerTips[i].y), 4);
|
sourceBuffer += unpackFloatScalarFromSignedTwoByteFixed((int16_t*) sourceBuffer, &(fingerTips[i].y), 4);
|
||||||
sourceBuffer += unpackFloatScalarFromSignedTwoByteFixed((int16_t*) sourceBuffer, &(fingerTips[i].z), 4);
|
sourceBuffer += unpackFloatScalarFromSignedTwoByteFixed((int16_t*) sourceBuffer, &(fingerTips[i].z), 4);
|
||||||
}
|
}
|
||||||
|
for (size_t i = 0; i < numFingerRoots; ++i) {
|
||||||
|
sourceBuffer += unpackFloatScalarFromSignedTwoByteFixed((int16_t*) sourceBuffer, &(fingerRoots[i].x), 4);
|
||||||
|
sourceBuffer += unpackFloatScalarFromSignedTwoByteFixed((int16_t*) sourceBuffer, &(fingerRoots[i].y), 4);
|
||||||
|
sourceBuffer += unpackFloatScalarFromSignedTwoByteFixed((int16_t*) sourceBuffer, &(fingerRoots[i].z), 4);
|
||||||
|
}
|
||||||
_handData->setFingerTips(fingerTips);
|
_handData->setFingerTips(fingerTips);
|
||||||
_handData->setFingerRoots(fingerRoots);
|
_handData->setFingerRoots(fingerRoots);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue