mirror of
https://github.com/lubosz/overte.git
synced 2025-04-25 00:03:16 +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) {
|
||||
// We've seen the same number of nearby entities for several stats packets in a row. assume we've got all
|
||||
// the local entities.
|
||||
bool result = true;
|
||||
foreach (EntityItemPointer entity, entities) {
|
||||
if (entity->shouldBePhysical() && !entity->isReadyToComputeShape()) {
|
||||
static QString repeatedMessage =
|
||||
LogHandler::getInstance().addRepeatedMessageRegex("Physics disabled until entity loads: .*");
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -646,6 +646,12 @@ bool RenderableModelEntityItem::isReadyToComputeShape() {
|
|||
// the model is still being downloaded.
|
||||
return false;
|
||||
} 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 true;
|
||||
|
|
Loading…
Reference in a new issue