mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
fix handling of an avatar's parent changing
This commit is contained in:
parent
1164a1b3bf
commit
0c2abc9883
1 changed files with 6 additions and 11 deletions
|
@ -258,8 +258,8 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
|
|||
// local position, and parent info only apply to avatars that are parented. The local position
|
||||
// and the parent info can change independently though, so we track their "changed since"
|
||||
// separately
|
||||
bool hasParentInfo = hasParent() && (sendAll || parentInfoChangedSince(lastSentTime));
|
||||
bool hasAvatarLocalPosition = hasParent() && (sendAll || tranlationChangedSince(lastSentTime));
|
||||
bool hasParentInfo = sendAll || parentInfoChangedSince(lastSentTime);
|
||||
bool hasAvatarLocalPosition = sendAll || tranlationChangedSince(lastSentTime);
|
||||
|
||||
bool hasFaceTrackerInfo = hasFaceTracker() && (sendAll || faceTrackerInfoChangedSince(lastSentTime));
|
||||
bool hasJointData = sendAll || !sendMinimum;
|
||||
|
@ -884,7 +884,7 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
|||
|
||||
sourceBuffer += sizeof(AvatarDataPacket::AdditionalFlags);
|
||||
|
||||
if (somethingChanged) {
|
||||
if (somethingChanged) {
|
||||
_additionalFlagsChanged = usecTimestampNow();
|
||||
}
|
||||
int numBytesRead = sourceBuffer - startSection;
|
||||
|
@ -892,8 +892,6 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
|||
_additionalFlagsUpdateRate.increment();
|
||||
}
|
||||
|
||||
// FIXME -- make sure to handle the existance of a parent vs a change in the parent...
|
||||
//bool hasReferential = oneAtBit(bitItems, HAS_REFERENTIAL);
|
||||
if (hasParentInfo) {
|
||||
auto startSection = sourceBuffer;
|
||||
PACKET_READ_CHECK(ParentInfo, sizeof(AvatarDataPacket::ParentInfo));
|
||||
|
@ -904,18 +902,15 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
|||
|
||||
auto newParentID = QUuid::fromRfc4122(byteArray);
|
||||
|
||||
if ((_parentID != newParentID) || (_parentJointIndex != parentInfo->parentJointIndex)) {
|
||||
setParentID(newParentID);
|
||||
setParentJointIndex(parentInfo->parentJointIndex);
|
||||
if ((getParentID() != newParentID) || (getParentJointIndex() != parentInfo->parentJointIndex)) {
|
||||
SpatiallyNestable::setParentID(newParentID);
|
||||
SpatiallyNestable::setParentJointIndex(parentInfo->parentJointIndex);
|
||||
_parentChanged = usecTimestampNow();
|
||||
}
|
||||
|
||||
int numBytesRead = sourceBuffer - startSection;
|
||||
_parentInfoRate.increment(numBytesRead);
|
||||
_parentInfoUpdateRate.increment();
|
||||
} else {
|
||||
// FIXME - this aint totally right, for switching to parent/no-parent
|
||||
setParentID(QUuid());
|
||||
}
|
||||
|
||||
if (hasAvatarLocalPosition) {
|
||||
|
|
Loading…
Reference in a new issue