Fixed bug having other people showing up at negative of their transmitted position.

This commit is contained in:
Philip Rosedale 2013-04-17 16:49:39 -07:00
parent 952cb2f2ae
commit 6b03622e29
2 changed files with 7 additions and 2 deletions

View file

@ -825,7 +825,7 @@ void display(void)
Head *agentHead = (Head *)agent->getLinkedData();
glPushMatrix();
glm::vec3 pos = agentHead->getBodyPosition();
glTranslatef(-pos.x, -pos.y, -pos.z);
glTranslatef(pos.x, pos.y, pos.z);
agentHead->render(0);
glPopMatrix();
}

View file

@ -59,10 +59,12 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _bodyPitch);
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _bodyRoll);
//printf( "_bodyYaw = %f", _bodyYaw );
memcpy(destinationBuffer, &_handPosition, sizeof(float) * 3);
destinationBuffer += sizeof(float) * 3;
//std::cout << _handPosition.x << ", " << _handPosition.y << ", " << _handPosition.z << "\n";
//std::cout << _bodyPosition.x << ", " << _bodyPosition.y << ", " << _bodyPosition.z << "\n";
return destinationBuffer - bufferStart;
}
@ -83,6 +85,9 @@ void AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
memcpy(&_handPosition, sourceBuffer, sizeof(float) * 3);
sourceBuffer += sizeof(float) * 3;
//std::cout << _bodyPosition.x << ", " << _bodyPosition.y << ", " << _bodyPosition.z << "\n";
}
glm::vec3 AvatarData::getBodyPosition() {