mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 16:36:54 +02:00
Merge branch 'protocol' of https://github.com/huffman/hifi into protocol
This commit is contained in:
commit
9a2f51c6de
1 changed files with 20 additions and 4 deletions
|
@ -166,10 +166,10 @@ QByteArray AvatarData::toByteArray() {
|
||||||
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->getFinalYaw());
|
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->getFinalYaw());
|
||||||
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->getFinalRoll());
|
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->getFinalRoll());
|
||||||
|
|
||||||
// // Body lean
|
// Body lean
|
||||||
// destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->_leanForward);
|
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->_leanForward);
|
||||||
// destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->_leanSideways);
|
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->_leanSideways);
|
||||||
// destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->_torsoTwist);
|
destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->_torsoTwist);
|
||||||
|
|
||||||
// Lookat Position
|
// Lookat Position
|
||||||
memcpy(destinationBuffer, &_headData->_lookAtPosition, sizeof(_headData->_lookAtPosition));
|
memcpy(destinationBuffer, &_headData->_lookAtPosition, sizeof(_headData->_lookAtPosition));
|
||||||
|
@ -371,6 +371,22 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
||||||
_headData->setBaseRoll(headRoll);
|
_headData->setBaseRoll(headRoll);
|
||||||
} // 6 bytes
|
} // 6 bytes
|
||||||
|
|
||||||
|
{ // Head lean (relative to pelvis)
|
||||||
|
float leanForward, leanSideways, torsoTwist;
|
||||||
|
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t*)sourceBuffer, &leanForward);
|
||||||
|
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t*)sourceBuffer, &leanSideways);
|
||||||
|
sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t*)sourceBuffer, &torsoTwist);
|
||||||
|
if (glm::isnan(leanForward) || glm::isnan(leanSideways)) {
|
||||||
|
if (shouldLogError(now)) {
|
||||||
|
qCDebug(avatars) << "Discard nan AvatarData::leanForward,leanSideways,torsoTwise; displayName = '" << _displayName << "'";
|
||||||
|
}
|
||||||
|
return maxAvailableSize;
|
||||||
|
}
|
||||||
|
_headData->_leanForward = leanForward;
|
||||||
|
_headData->_leanSideways = leanSideways;
|
||||||
|
_headData->_torsoTwist = torsoTwist;
|
||||||
|
} // 6 bytes
|
||||||
|
|
||||||
{ // Lookat Position
|
{ // Lookat Position
|
||||||
glm::vec3 lookAt;
|
glm::vec3 lookAt;
|
||||||
memcpy(&lookAt, sourceBuffer, sizeof(lookAt));
|
memcpy(&lookAt, sourceBuffer, sizeof(lookAt));
|
||||||
|
|
Loading…
Reference in a new issue