mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 23:09:52 +02:00
Merge branch 'stable' of https://github.com/highfidelity/hifi into new-master
This commit is contained in:
commit
8a903c8b12
3 changed files with 23 additions and 1 deletions
|
@ -295,6 +295,14 @@ void EntityRenderer::updateInScene(const ScenePointer& scene, Transaction& trans
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EntityRenderer::clearSubRenderItemIDs() {
|
||||||
|
_subRenderItemIDs.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void EntityRenderer::setSubRenderItemIDs(const render::ItemIDs& ids) {
|
||||||
|
_subRenderItemIDs = ids;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Internal methods
|
// Internal methods
|
||||||
//
|
//
|
||||||
|
|
|
@ -49,6 +49,9 @@ public:
|
||||||
virtual bool addToScene(const ScenePointer& scene, Transaction& transaction) final;
|
virtual bool addToScene(const ScenePointer& scene, Transaction& transaction) final;
|
||||||
virtual void removeFromScene(const ScenePointer& scene, Transaction& transaction);
|
virtual void removeFromScene(const ScenePointer& scene, Transaction& transaction);
|
||||||
|
|
||||||
|
void clearSubRenderItemIDs();
|
||||||
|
void setSubRenderItemIDs(const render::ItemIDs& ids);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool needsRenderUpdateFromEntity() const final { return needsRenderUpdateFromEntity(_entity); }
|
virtual bool needsRenderUpdateFromEntity() const final { return needsRenderUpdateFromEntity(_entity); }
|
||||||
virtual void onAddToScene(const EntityItemPointer& entity);
|
virtual void onAddToScene(const EntityItemPointer& entity);
|
||||||
|
@ -113,6 +116,7 @@ protected:
|
||||||
SharedSoundPointer _collisionSound;
|
SharedSoundPointer _collisionSound;
|
||||||
QUuid _changeHandlerId;
|
QUuid _changeHandlerId;
|
||||||
ItemID _renderItemID{ Item::INVALID_ITEM_ID };
|
ItemID _renderItemID{ Item::INVALID_ITEM_ID };
|
||||||
|
ItemIDs _subRenderItemIDs;
|
||||||
quint64 _fadeStartTime{ usecTimestampNow() };
|
quint64 _fadeStartTime{ usecTimestampNow() };
|
||||||
bool _isFading{ _entitiesShouldFadeFunction() };
|
bool _isFading{ _entitiesShouldFadeFunction() };
|
||||||
bool _prevIsTransparent { false };
|
bool _prevIsTransparent { false };
|
||||||
|
|
|
@ -953,7 +953,7 @@ ItemKey ModelEntityRenderer::getKey() {
|
||||||
|
|
||||||
uint32_t ModelEntityRenderer::metaFetchMetaSubItems(ItemIDs& subItems) {
|
uint32_t ModelEntityRenderer::metaFetchMetaSubItems(ItemIDs& subItems) {
|
||||||
if (_model) {
|
if (_model) {
|
||||||
auto metaSubItems = _model->fetchRenderItemIDs();
|
auto metaSubItems = _subRenderItemIDs;
|
||||||
subItems.insert(subItems.end(), metaSubItems.begin(), metaSubItems.end());
|
subItems.insert(subItems.end(), metaSubItems.begin(), metaSubItems.end());
|
||||||
return (uint32_t)metaSubItems.size();
|
return (uint32_t)metaSubItems.size();
|
||||||
}
|
}
|
||||||
|
@ -1202,6 +1202,10 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
|
||||||
if ((bool)model) {
|
if ((bool)model) {
|
||||||
model->removeFromScene(scene, transaction);
|
model->removeFromScene(scene, transaction);
|
||||||
withWriteLock([&] { _model.reset(); });
|
withWriteLock([&] { _model.reset(); });
|
||||||
|
transaction.updateItem<PayloadProxyInterface>(getRenderItemID(), [](PayloadProxyInterface& data) {
|
||||||
|
auto entityRenderer = static_cast<EntityRenderer*>(&data);
|
||||||
|
entityRenderer->clearSubRenderItemIDs();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1297,6 +1301,12 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
|
||||||
render::Item::Status::Getters statusGetters;
|
render::Item::Status::Getters statusGetters;
|
||||||
makeStatusGetters(entity, statusGetters);
|
makeStatusGetters(entity, statusGetters);
|
||||||
model->addToScene(scene, transaction, statusGetters);
|
model->addToScene(scene, transaction, statusGetters);
|
||||||
|
|
||||||
|
auto newRenderItemIDs{ model->fetchRenderItemIDs() };
|
||||||
|
transaction.updateItem<PayloadProxyInterface>(getRenderItemID(), [newRenderItemIDs](PayloadProxyInterface& data) {
|
||||||
|
auto entityRenderer = static_cast<EntityRenderer*>(&data);
|
||||||
|
entityRenderer->setSubRenderItemIDs(newRenderItemIDs);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue