mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
Corrects loading of texture and default visibility.
This commit is contained in:
parent
89e7e3b938
commit
630df7c233
2 changed files with 7 additions and 4 deletions
|
@ -27,10 +27,6 @@ ModelOverlay::ModelOverlay()
|
|||
{
|
||||
_model->setLoadingPriority(_loadPriority);
|
||||
_isLoaded = false;
|
||||
|
||||
// Don't show overlay until textures have loaded
|
||||
_visible = false;
|
||||
|
||||
render::ScenePointer scene = qApp->getMain3DScene();
|
||||
_model->setVisibleInScene(false, scene);
|
||||
}
|
||||
|
@ -136,6 +132,11 @@ void ModelOverlay::update(float deltatime) {
|
|||
}
|
||||
scene->enqueueTransaction(transaction);
|
||||
|
||||
if (_texturesDirty && !_modelTextures.isEmpty()) {
|
||||
_texturesDirty = false;
|
||||
_model->setTextures(_modelTextures);
|
||||
}
|
||||
|
||||
if (!_texturesLoaded && _model->getGeometry() && _model->getGeometry()->areTexturesLoaded()) {
|
||||
_texturesLoaded = true;
|
||||
if (!_modelTextures.isEmpty()) {
|
||||
|
@ -242,6 +243,7 @@ void ModelOverlay::setProperties(const QVariantMap& properties) {
|
|||
_texturesLoaded = false;
|
||||
QVariantMap textureMap = texturesValue.toMap();
|
||||
_modelTextures = textureMap;
|
||||
_texturesDirty = true;
|
||||
}
|
||||
|
||||
auto groupCulledValue = properties["isGroupCulled"];
|
||||
|
|
|
@ -94,6 +94,7 @@ private:
|
|||
ModelPointer _model;
|
||||
QVariantMap _modelTextures;
|
||||
bool _texturesLoaded { false };
|
||||
bool _texturesDirty{ false };
|
||||
|
||||
render::ItemIDs _subRenderItemIDs;
|
||||
|
||||
|
|
Loading…
Reference in a new issue