mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-26 03:15:21 +02:00
some necessary changes for AvatarData transmission
This commit is contained in:
parent
aed0aa3034
commit
71ab8ae4f8
2 changed files with 5 additions and 9 deletions
|
@ -2357,7 +2357,7 @@ void Application::updateAvatar(float deltaTime) {
|
||||||
NodeList* nodeList = NodeList::getInstance();
|
NodeList* nodeList = NodeList::getInstance();
|
||||||
if (nodeList->getOwnerID() != UNKNOWN_NODE_ID) {
|
if (nodeList->getOwnerID() != UNKNOWN_NODE_ID) {
|
||||||
// if I know my ID, send head/hand data to the avatar mixer and voxel server
|
// if I know my ID, send head/hand data to the avatar mixer and voxel server
|
||||||
unsigned char broadcastString[200];
|
unsigned char broadcastString[MAX_PACKET_SIZE];
|
||||||
unsigned char* endOfBroadcastStringWrite = broadcastString;
|
unsigned char* endOfBroadcastStringWrite = broadcastString;
|
||||||
|
|
||||||
endOfBroadcastStringWrite += populateTypeAndVersion(endOfBroadcastStringWrite, PACKET_TYPE_HEAD_DATA);
|
endOfBroadcastStringWrite += populateTypeAndVersion(endOfBroadcastStringWrite, PACKET_TYPE_HEAD_DATA);
|
||||||
|
|
|
@ -132,10 +132,6 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
|
||||||
std::vector<glm::vec3> fingerVectors;
|
std::vector<glm::vec3> fingerVectors;
|
||||||
_handData->encodeRemoteData(fingerVectors);
|
_handData->encodeRemoteData(fingerVectors);
|
||||||
|
|
||||||
/////////////////////////////////
|
|
||||||
// Temporarily disable Leap finger sending, as it's causing a crash whenever someone's got a Leap connected
|
|
||||||
fingerVectors.clear();
|
|
||||||
/////////////////////////////////
|
|
||||||
if (fingerVectors.size() > 255)
|
if (fingerVectors.size() > 255)
|
||||||
fingerVectors.clear(); // safety. We shouldn't ever get over 255, so consider that invalid.
|
fingerVectors.clear(); // safety. We shouldn't ever get over 255, so consider that invalid.
|
||||||
|
|
||||||
|
@ -249,8 +245,8 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
|
||||||
_handState = getSemiNibbleAt(bitItems,HAND_STATE_START_BIT);
|
_handState = getSemiNibbleAt(bitItems,HAND_STATE_START_BIT);
|
||||||
|
|
||||||
// leap hand data
|
// leap hand data
|
||||||
if (sourceBuffer - startPosition < numBytes) // safety check
|
if (sourceBuffer - startPosition < numBytes) {
|
||||||
{
|
// check passed, bytes match
|
||||||
unsigned int numFingerVectors = *sourceBuffer++;
|
unsigned int numFingerVectors = *sourceBuffer++;
|
||||||
if (numFingerVectors > 0) {
|
if (numFingerVectors > 0) {
|
||||||
std::vector<glm::vec3> fingerVectors(numFingerVectors);
|
std::vector<glm::vec3> fingerVectors(numFingerVectors);
|
||||||
|
@ -264,8 +260,8 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// skeleton joints
|
// skeleton joints
|
||||||
if (sourceBuffer - startPosition < numBytes) // safety check
|
if (sourceBuffer - startPosition < numBytes) {
|
||||||
{
|
// check passed, bytes match
|
||||||
_joints.resize(*sourceBuffer++);
|
_joints.resize(*sourceBuffer++);
|
||||||
for (vector<JointData>::iterator it = _joints.begin(); it != _joints.end(); it++) {
|
for (vector<JointData>::iterator it = _joints.begin(); it != _joints.end(); it++) {
|
||||||
it->jointID = *sourceBuffer++;
|
it->jointID = *sourceBuffer++;
|
||||||
|
|
Loading…
Reference in a new issue