Let other users see your default avatar.

Fixes https://app.asana.com/0/26225263936266/51001490412567
This commit is contained in:
Howard Stearns 2015-09-20 13:12:13 -07:00
parent ec87502f49
commit 4d2048c6f6
3 changed files with 6 additions and 5 deletions

View file

@ -73,7 +73,7 @@ AvatarData::~AvatarData() {
// We cannot have a file-level variable (const or otherwise) in the header if it uses PathUtils, because that references Application, which will not yet initialized. // We cannot have a file-level variable (const or otherwise) in the header if it uses PathUtils, because that references Application, which will not yet initialized.
// Thus we have a static class getter, referencing a static class var. // Thus we have a static class getter, referencing a static class var.
QUrl AvatarData::_defaultFullAvatarModelUrl = {}; // In C++, if this initialization were in the header, every file would have it's own copy, even for class vars. QUrl AvatarData::_defaultFullAvatarModelUrl = {}; // In C++, if this initialization were in the header, every file would have it's own copy, even for class vars.
const QUrl AvatarData::defaultFullAvatarModelUrl() { const QUrl& AvatarData::defaultFullAvatarModelUrl() {
if (_defaultFullAvatarModelUrl.isEmpty()) { if (_defaultFullAvatarModelUrl.isEmpty()) {
_defaultFullAvatarModelUrl = QUrl::fromLocalFile(PathUtils::resourcesPath() + "meshes/defaultAvatar_full.fst"); _defaultFullAvatarModelUrl = QUrl::fromLocalFile(PathUtils::resourcesPath() + "meshes/defaultAvatar_full.fst");
} }
@ -966,8 +966,9 @@ bool AvatarData::hasIdentityChangedAfterParsing(NLPacket& packet) {
QByteArray AvatarData::identityByteArray() { QByteArray AvatarData::identityByteArray() {
QByteArray identityData; QByteArray identityData;
QDataStream identityStream(&identityData, QIODevice::Append); QDataStream identityStream(&identityData, QIODevice::Append);
const QUrl& urlToSend = (_skeletonModelURL == AvatarData::defaultFullAvatarModelUrl()) ? QUrl("") : _skeletonModelURL;
identityStream << QUuid() << _faceModelURL << _skeletonModelURL << _attachmentData << _displayName; identityStream << QUuid() << _faceModelURL << urlToSend << _attachmentData << _displayName;
return identityData; return identityData;
} }

View file

@ -166,7 +166,7 @@ public:
AvatarData(); AvatarData();
virtual ~AvatarData(); virtual ~AvatarData();
static const QUrl defaultFullAvatarModelUrl(); static const QUrl& defaultFullAvatarModelUrl();
virtual bool isMyAvatar() const { return false; } virtual bool isMyAvatar() const { return false; }

View file

@ -99,8 +99,8 @@ void AvatarHashMap::processAvatarIdentityPacket(QSharedPointer<NLPacket> packet,
avatar->setFaceModelURL(faceMeshURL); avatar->setFaceModelURL(faceMeshURL);
} }
if (avatar->getSkeletonModelURL() != skeletonURL) { if (avatar->getSkeletonModelURL().isEmpty() || (avatar->getSkeletonModelURL() != skeletonURL)) {
avatar->setSkeletonModelURL(skeletonURL); avatar->setSkeletonModelURL(skeletonURL); // Will expand "" to default and so will not continuously fire
} }
if (avatar->getAttachmentData() != attachmentData) { if (avatar->getAttachmentData() != attachmentData) {