mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 23:14:34 +02:00
Merge pull request #9390 from sethalves/load-models-in-keyhole
fix physics not starting up when a model is close behind
This commit is contained in:
commit
f900629cdb
2 changed files with 10 additions and 2 deletions
|
@ -5297,15 +5297,17 @@ bool Application::nearbyEntitiesAreReadyForPhysics() {
|
||||||
if (_nearbyEntitiesStabilityCount >= MINIMUM_NEARBY_ENTITIES_STABILITY_COUNT) {
|
if (_nearbyEntitiesStabilityCount >= MINIMUM_NEARBY_ENTITIES_STABILITY_COUNT) {
|
||||||
// We've seen the same number of nearby entities for several stats packets in a row. assume we've got all
|
// We've seen the same number of nearby entities for several stats packets in a row. assume we've got all
|
||||||
// the local entities.
|
// the local entities.
|
||||||
|
bool result = true;
|
||||||
foreach (EntityItemPointer entity, entities) {
|
foreach (EntityItemPointer entity, entities) {
|
||||||
if (entity->shouldBePhysical() && !entity->isReadyToComputeShape()) {
|
if (entity->shouldBePhysical() && !entity->isReadyToComputeShape()) {
|
||||||
static QString repeatedMessage =
|
static QString repeatedMessage =
|
||||||
LogHandler::getInstance().addRepeatedMessageRegex("Physics disabled until entity loads: .*");
|
LogHandler::getInstance().addRepeatedMessageRegex("Physics disabled until entity loads: .*");
|
||||||
qCDebug(interfaceapp) << "Physics disabled until entity loads: " << entity->getID() << entity->getName();
|
qCDebug(interfaceapp) << "Physics disabled until entity loads: " << entity->getID() << entity->getName();
|
||||||
return false;
|
// don't break here because we want all the relevant entities to start their downloads
|
||||||
|
result = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return result;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -646,6 +646,12 @@ bool RenderableModelEntityItem::isReadyToComputeShape() {
|
||||||
// the model is still being downloaded.
|
// the model is still being downloaded.
|
||||||
return false;
|
return false;
|
||||||
} else if (type >= SHAPE_TYPE_SIMPLE_HULL && type <= SHAPE_TYPE_STATIC_MESH) {
|
} else if (type >= SHAPE_TYPE_SIMPLE_HULL && type <= SHAPE_TYPE_STATIC_MESH) {
|
||||||
|
if (!_model) {
|
||||||
|
EntityTreePointer tree = getTree();
|
||||||
|
if (tree) {
|
||||||
|
QMetaObject::invokeMethod(tree.get(), "callLoader", Qt::QueuedConnection, Q_ARG(EntityItemID, getID()));
|
||||||
|
}
|
||||||
|
}
|
||||||
return (_model && _model->isLoaded());
|
return (_model && _model->isLoaded());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue