mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-29 18:25:27 +02:00
Merge pull request #14815 from SimonWalton-HiFi/avatar-data-packet-overrun-rc79
79.0: Include the new scale float in min remaining size calculation
This commit is contained in:
commit
5aeaa87bc4
1 changed files with 6 additions and 3 deletions
|
@ -632,9 +632,11 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
|
||||||
|
|
||||||
// include jointData if there is room for the most minimal section. i.e. no translations or rotations.
|
// include jointData if there is room for the most minimal section. i.e. no translations or rotations.
|
||||||
IF_AVATAR_SPACE(PACKET_HAS_JOINT_DATA, AvatarDataPacket::minJointDataSize(numJoints)) {
|
IF_AVATAR_SPACE(PACKET_HAS_JOINT_DATA, AvatarDataPacket::minJointDataSize(numJoints)) {
|
||||||
// Allow for faux joints + translation bit-vector:
|
// Minimum space required for another rotation joint -
|
||||||
const ptrdiff_t minSizeForJoint = sizeof(AvatarDataPacket::SixByteQuat)
|
// size of joint + following translation bit-vector + translation scale + faux joints:
|
||||||
+ jointBitVectorSize + AvatarDataPacket::FAUX_JOINTS_SIZE;
|
const ptrdiff_t minSizeForJoint = sizeof(AvatarDataPacket::SixByteQuat) + jointBitVectorSize +
|
||||||
|
sizeof(float) + AvatarDataPacket::FAUX_JOINTS_SIZE;
|
||||||
|
|
||||||
auto startSection = destinationBuffer;
|
auto startSection = destinationBuffer;
|
||||||
|
|
||||||
// compute maxTranslationDimension before we send any joint data.
|
// compute maxTranslationDimension before we send any joint data.
|
||||||
|
@ -724,6 +726,7 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
|
||||||
const JointData& data = joints[i];
|
const JointData& data = joints[i];
|
||||||
const JointData& last = lastSentJointData[i];
|
const JointData& last = lastSentJointData[i];
|
||||||
|
|
||||||
|
// Note minSizeForJoint is conservative since there isn't a following bit-vector + scale.
|
||||||
if (packetEnd - destinationBuffer >= minSizeForJoint) {
|
if (packetEnd - destinationBuffer >= minSizeForJoint) {
|
||||||
if (!data.translationIsDefaultPose) {
|
if (!data.translationIsDefaultPose) {
|
||||||
if (sendAll || last.translationIsDefaultPose || (!cullSmallChanges && last.translation != data.translation)
|
if (sendAll || last.translationIsDefaultPose || (!cullSmallChanges && last.translation != data.translation)
|
||||||
|
|
Loading…
Reference in a new issue