mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 13:33:38 +02:00
Cleanup implementation of angular loading
This commit is contained in:
parent
c594dcdf9f
commit
77e993510e
4 changed files with 8 additions and 7 deletions
|
@ -529,7 +529,7 @@ void EntityTreeRenderer::processEraseMessage(ReceivedMessage& message, const Sha
|
|||
std::static_pointer_cast<EntityTree>(_tree)->processEraseMessage(message, sourceNode);
|
||||
}
|
||||
|
||||
ModelPointer EntityTreeRenderer::allocateModel(const QString& url, const QString& collisionUrl, float priority) {
|
||||
ModelPointer EntityTreeRenderer::allocateModel(const QString& url, const QString& collisionUrl, float loadingPriority) {
|
||||
ModelPointer model = nullptr;
|
||||
|
||||
// Only create and delete models on the thread that owns the EntityTreeRenderer
|
||||
|
@ -543,7 +543,7 @@ ModelPointer EntityTreeRenderer::allocateModel(const QString& url, const QString
|
|||
}
|
||||
|
||||
model = std::make_shared<Model>(std::make_shared<Rig>());
|
||||
model->priority = priority;
|
||||
model->setLoadingPriority(loadingPriority);
|
||||
model->init();
|
||||
model->setURL(QUrl(url));
|
||||
model->setCollisionModelURL(QUrl(collisionUrl));
|
||||
|
|
|
@ -46,8 +46,6 @@ public:
|
|||
virtual PacketType getExpectedPacketType() const { return PacketType::EntityData; }
|
||||
virtual void setTree(OctreePointer newTree);
|
||||
|
||||
glm::vec3 cameraPosition {};
|
||||
|
||||
void shutdown();
|
||||
void update();
|
||||
|
||||
|
@ -68,7 +66,7 @@ public:
|
|||
void reloadEntityScripts();
|
||||
|
||||
/// if a renderable entity item needs a model, we will allocate it for them
|
||||
Q_INVOKABLE ModelPointer allocateModel(const QString& url, const QString& collisionUrl, float priority = 0);
|
||||
Q_INVOKABLE ModelPointer allocateModel(const QString& url, const QString& collisionUrl, float loadingPriority = 0);
|
||||
|
||||
/// if a renderable entity item needs to update the URL of a model, we will handle that for the entity
|
||||
Q_INVOKABLE ModelPointer updateModel(ModelPointer original, const QString& newUrl, const QString& collisionUrl);
|
||||
|
|
|
@ -828,7 +828,6 @@ void Model::setURL(const QUrl& url) {
|
|||
|
||||
auto resource = DependencyManager::get<ModelCache>()->getGeometryResource(url);
|
||||
resource->setLoadPriority(this, priority);
|
||||
qDebug() << "Setting priority to: " << priority;
|
||||
_renderWatcher.setResource(resource);
|
||||
onInvalidate();
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ public:
|
|||
// returns 'true' if needs fullUpdate after geometry change
|
||||
bool updateGeometry();
|
||||
|
||||
float priority { 0 };
|
||||
float setLoadingPriority(float priority) { _loadingPriority = priority; }
|
||||
|
||||
public slots:
|
||||
void loadURLFinished(bool success);
|
||||
|
@ -407,6 +407,10 @@ protected:
|
|||
|
||||
bool _visualGeometryRequestFailed { false };
|
||||
bool _collisionGeometryRequestFailed { false };
|
||||
|
||||
private:
|
||||
float _loadingPriority { 0 };
|
||||
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(ModelPointer)
|
||||
|
|
Loading…
Reference in a new issue