mirror of
https://github.com/overte-org/overte.git
synced 2025-06-26 12:49:33 +02:00
remember hash of AvatarEntityItemData
This commit is contained in:
parent
ff746c3141
commit
fab3e5e3fd
5 changed files with 18 additions and 10 deletions
|
@ -510,6 +510,11 @@ void OtherAvatar::handleChangedAvatarEntityData() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stateItr.value().success = success;
|
stateItr.value().success = success;
|
||||||
|
if (success) {
|
||||||
|
stateItr.value().hash = newHash;
|
||||||
|
} else {
|
||||||
|
stateItr.value().hash = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AvatarEntityIDs recentlyRemovedAvatarEntities = getAndClearRecentlyRemovedIDs();
|
AvatarEntityIDs recentlyRemovedAvatarEntities = getAndClearRecentlyRemovedIDs();
|
||||||
|
|
|
@ -76,6 +76,16 @@ protected:
|
||||||
void onAddAttachedAvatarEntity(const QUuid& id);
|
void onAddAttachedAvatarEntity(const QUuid& id);
|
||||||
void onRemoveAttachedAvatarEntity(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::vector<QUuid> _attachedAvatarEntities;
|
||||||
std::shared_ptr<Sphere3DOverlay> _otherAvatarOrbMeshPlaceholder { nullptr };
|
std::shared_ptr<Sphere3DOverlay> _otherAvatarOrbMeshPlaceholder { nullptr };
|
||||||
OverlayID _otherAvatarOrbMeshPlaceholderID { UNKNOWN_OVERLAY_ID };
|
OverlayID _otherAvatarOrbMeshPlaceholderID { UNKNOWN_OVERLAY_ID };
|
||||||
|
|
|
@ -305,11 +305,6 @@ void Avatar::setTargetScale(float targetScale) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Avatar::setAvatarEntityDataChanged(bool value) {
|
|
||||||
AvatarData::setAvatarEntityDataChanged(value);
|
|
||||||
_avatarEntityDataHashes.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Avatar::removeAvatarEntitiesFromTree() {
|
void Avatar::removeAvatarEntitiesFromTree() {
|
||||||
auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
|
auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
|
||||||
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
|
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
|
||||||
|
|
|
@ -480,8 +480,6 @@ public:
|
||||||
virtual void setModelScale(float scale) { _modelScale = scale; }
|
virtual void setModelScale(float scale) { _modelScale = scale; }
|
||||||
virtual glm::vec3 scaleForChildren() const override { return glm::vec3(getModelScale()); }
|
virtual glm::vec3 scaleForChildren() const override { return glm::vec3(getModelScale()); }
|
||||||
|
|
||||||
virtual void setAvatarEntityDataChanged(bool value) override;
|
|
||||||
|
|
||||||
// Show hide the model representation of the avatar
|
// Show hide the model representation of the avatar
|
||||||
virtual void setEnableMeshVisible(bool isEnabled);
|
virtual void setEnableMeshVisible(bool isEnabled);
|
||||||
virtual bool getEnableMeshVisible() const;
|
virtual bool getEnableMeshVisible() const;
|
||||||
|
@ -647,8 +645,8 @@ protected:
|
||||||
bool success { false };
|
bool success { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
using MapOfAvatarEntityDataHashes = QMap<QUuid, AvatarEntityDataHash>;
|
//using MapOfAvatarEntityDataHashes = QMap<QUuid, AvatarEntityDataHash>;
|
||||||
MapOfAvatarEntityDataHashes _avatarEntityDataHashes;
|
//MapOfAvatarEntityDataHashes _avatarEntityDataHashes;
|
||||||
|
|
||||||
uint64_t _lastRenderUpdateTime { 0 };
|
uint64_t _lastRenderUpdateTime { 0 };
|
||||||
int _leftPointerGeometryID { 0 };
|
int _leftPointerGeometryID { 0 };
|
||||||
|
|
|
@ -1147,7 +1147,7 @@ public:
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE virtual void setAvatarEntityData(const AvatarEntityMap& avatarEntityData);
|
Q_INVOKABLE virtual void setAvatarEntityData(const AvatarEntityMap& avatarEntityData);
|
||||||
|
|
||||||
virtual void setAvatarEntityDataChanged(bool value) { _avatarEntityDataChanged = value; }
|
void setAvatarEntityDataChanged(bool value) { _avatarEntityDataChanged = value; }
|
||||||
AvatarEntityIDs getAndClearRecentlyRemovedIDs();
|
AvatarEntityIDs getAndClearRecentlyRemovedIDs();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
|
Loading…
Reference in a new issue