remember hash of AvatarEntityItemData

This commit is contained in:
Andrew Meadows 2019-02-11 16:13:56 -08:00
parent ff746c3141
commit fab3e5e3fd
5 changed files with 18 additions and 10 deletions

View file

@ -510,6 +510,11 @@ void OtherAvatar::handleChangedAvatarEntityData() {
}
}
stateItr.value().success = success;
if (success) {
stateItr.value().hash = newHash;
} else {
stateItr.value().hash = 0;
}
}
AvatarEntityIDs recentlyRemovedAvatarEntities = getAndClearRecentlyRemovedIDs();

View file

@ -76,6 +76,16 @@ protected:
void onAddAttachedAvatarEntity(const QUuid& id);
void onRemoveAttachedAvatarEntity(const QUuid& id);
class AvatarEntityDataHash {
public:
AvatarEntityDataHash(uint32_t h) : hash(h) {};
uint32_t hash { 0 };
bool success { false };
};
using MapOfAvatarEntityDataHashes = QMap<QUuid, AvatarEntityDataHash>;
MapOfAvatarEntityDataHashes _avatarEntityDataHashes;
std::vector<QUuid> _attachedAvatarEntities;
std::shared_ptr<Sphere3DOverlay> _otherAvatarOrbMeshPlaceholder { nullptr };
OverlayID _otherAvatarOrbMeshPlaceholderID { UNKNOWN_OVERLAY_ID };

View file

@ -305,11 +305,6 @@ void Avatar::setTargetScale(float targetScale) {
}
}
void Avatar::setAvatarEntityDataChanged(bool value) {
AvatarData::setAvatarEntityDataChanged(value);
_avatarEntityDataHashes.clear();
}
void Avatar::removeAvatarEntitiesFromTree() {
auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;

View file

@ -480,8 +480,6 @@ public:
virtual void setModelScale(float scale) { _modelScale = scale; }
virtual glm::vec3 scaleForChildren() const override { return glm::vec3(getModelScale()); }
virtual void setAvatarEntityDataChanged(bool value) override;
// Show hide the model representation of the avatar
virtual void setEnableMeshVisible(bool isEnabled);
virtual bool getEnableMeshVisible() const;
@ -647,8 +645,8 @@ protected:
bool success { false };
};
using MapOfAvatarEntityDataHashes = QMap<QUuid, AvatarEntityDataHash>;
MapOfAvatarEntityDataHashes _avatarEntityDataHashes;
//using MapOfAvatarEntityDataHashes = QMap<QUuid, AvatarEntityDataHash>;
//MapOfAvatarEntityDataHashes _avatarEntityDataHashes;
uint64_t _lastRenderUpdateTime { 0 };
int _leftPointerGeometryID { 0 };

View file

@ -1147,7 +1147,7 @@ public:
*/
Q_INVOKABLE virtual void setAvatarEntityData(const AvatarEntityMap& avatarEntityData);
virtual void setAvatarEntityDataChanged(bool value) { _avatarEntityDataChanged = value; }
void setAvatarEntityDataChanged(bool value) { _avatarEntityDataChanged = value; }
AvatarEntityIDs getAndClearRecentlyRemovedIDs();
/**jsdoc