CR feedback

This commit is contained in:
ZappoMan 2017-01-24 12:47:47 -08:00
parent b3eb87e8db
commit 1309af6d7a
3 changed files with 8 additions and 4 deletions

View file

@ -114,7 +114,9 @@ public:
} }
QVector<JointData>& getLastOtherAvatarSentJoints(QUuid otherAvatar) { QVector<JointData>& getLastOtherAvatarSentJoints(QUuid otherAvatar) {
return _lastOtherAvatarSentJoints[otherAvatar]; auto result = _lastOtherAvatarSentJoints[otherAvatar];
result.resize(_avatar->getJointCount());
return result;
} }

View file

@ -429,9 +429,7 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
#endif #endif
if (sentJointDataOut) { if (sentJointDataOut) {
if (sentJointDataOut->size() != _jointData.size()) { sentJointDataOut->resize(_jointData.size()); // Make sure the destination is resized before using it
sentJointDataOut->resize(_jointData.size());
}
} }
float minRotationDOT = !distanceAdjust ? AVATAR_MIN_ROTATION_DOT : getDistanceBasedMinRotationDOT(viewerPosition); float minRotationDOT = !distanceAdjust ? AVATAR_MIN_ROTATION_DOT : getDistanceBasedMinRotationDOT(viewerPosition);
@ -1538,6 +1536,7 @@ void AvatarData::sendAvatarDataPacket() {
QVector<JointData> lastSentJointData; QVector<JointData> lastSentJointData;
{ {
QReadLocker readLock(&_jointDataLock); QReadLocker readLock(&_jointDataLock);
_lastSentJointData.resize(_jointData.size());
lastSentJointData = _lastSentJointData; lastSentJointData = _lastSentJointData;
} }
QByteArray avatarByteArray = toByteArray(dataDetail, 0, lastSentJointData); QByteArray avatarByteArray = toByteArray(dataDetail, 0, lastSentJointData);

View file

@ -536,8 +536,11 @@ public:
float getDataRate(const QString& rateName = QString("")); float getDataRate(const QString& rateName = QString(""));
int getJointCount() { return _jointData.size(); }
QVector<JointData> getLastSentJointData() { QVector<JointData> getLastSentJointData() {
QReadLocker readLock(&_jointDataLock); QReadLocker readLock(&_jointDataLock);
_lastSentJointData.resize(_jointData.size());
return _lastSentJointData; return _lastSentJointData;
} }