mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 01:36:56 +02:00
avoid sending localPosition for avatars with no parent
This commit is contained in:
parent
27d55d6ff0
commit
b333126cbe
1 changed files with 7 additions and 4 deletions
|
@ -260,8 +260,8 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
|
||||||
// separately
|
// separately
|
||||||
bool hasParentInfo = sendAll || parentInfoChangedSince(lastSentTime);
|
bool hasParentInfo = sendAll || parentInfoChangedSince(lastSentTime);
|
||||||
bool hasAvatarLocalPosition = sendAll ||
|
bool hasAvatarLocalPosition = sendAll ||
|
||||||
(hasParent() && tranlationChangedSince(lastSentTime)) ||
|
(hasParent() && (tranlationChangedSince(lastSentTime) ||
|
||||||
parentInfoChangedSince(lastSentTime);
|
parentInfoChangedSince(lastSentTime)));
|
||||||
|
|
||||||
bool hasFaceTrackerInfo = hasFaceTracker() && (sendAll || faceTrackerInfoChangedSince(lastSentTime));
|
bool hasFaceTrackerInfo = hasFaceTracker() && (sendAll || faceTrackerInfoChangedSince(lastSentTime));
|
||||||
bool hasJointData = sendAll || !sendMinimum;
|
bool hasJointData = sendAll || !sendMinimum;
|
||||||
|
@ -916,7 +916,6 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasAvatarLocalPosition) {
|
if (hasAvatarLocalPosition) {
|
||||||
assert(hasParent()); // we shouldn't have local position unless we have a parent
|
|
||||||
auto startSection = sourceBuffer;
|
auto startSection = sourceBuffer;
|
||||||
|
|
||||||
PACKET_READ_CHECK(AvatarLocalPosition, sizeof(AvatarDataPacket::AvatarLocalPosition));
|
PACKET_READ_CHECK(AvatarLocalPosition, sizeof(AvatarDataPacket::AvatarLocalPosition));
|
||||||
|
@ -928,7 +927,11 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
||||||
}
|
}
|
||||||
return buffer.size();
|
return buffer.size();
|
||||||
}
|
}
|
||||||
setLocalPosition(position);
|
if (hasParent()) {
|
||||||
|
setLocalPosition(position);
|
||||||
|
} else {
|
||||||
|
qCWarning(avatars) << "received localPosition for avatar with no parent";
|
||||||
|
}
|
||||||
sourceBuffer += sizeof(AvatarDataPacket::AvatarLocalPosition);
|
sourceBuffer += sizeof(AvatarDataPacket::AvatarLocalPosition);
|
||||||
int numBytesRead = sourceBuffer - startSection;
|
int numBytesRead = sourceBuffer - startSection;
|
||||||
_localPositionRate.increment(numBytesRead);
|
_localPositionRate.increment(numBytesRead);
|
||||||
|
|
Loading…
Reference in a new issue