From 0d8fdf51c55de711044ff909336d073678c5a834 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 1 Jul 2019 14:18:19 -0700 Subject: [PATCH] fix safe landing to load proper set of objects --- interface/src/Application.cpp | 10 ++++++++-- interface/src/octree/SafeLanding.cpp | 4 +--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 5f43f34731..b0f706a201 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1376,6 +1376,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo connect(myAvatar.get(), &MyAvatar::positionGoneTo, DependencyManager::get().data(), &AddressManager::storeCurrentAddress); + connect(myAvatar.get(), &MyAvatar::positionGoneTo, this, [this] { + if (!_physicsEnabled) { + // when we arrive somewhere without physics enabled --> startSafeLanding + _octreeProcessor.startSafeLanding(); + } + }, Qt::QueuedConnection); + connect(myAvatar.get(), &MyAvatar::skeletonModelURLChanged, [](){ QUrl avatarURL = qApp->getMyAvatar()->getSkeletonModelURL(); setCrashAnnotation("avatar", avatarURL.toString().toStdString()); @@ -5931,10 +5938,8 @@ void Application::resetPhysicsReadyInformation() { _gpuTextureMemSizeStabilityCount = 0; _gpuTextureMemSizeAtLastCheck = 0; _physicsEnabled = false; - _octreeProcessor.startSafeLanding(); } - void Application::reloadResourceCaches() { resetPhysicsReadyInformation(); @@ -6932,6 +6937,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType) { bool interstitialModeEnabled = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); ConicalViewFrustum sphericalView; + sphericalView.set(_viewFrustum); sphericalView.setSimpleRadius(INITIAL_QUERY_RADIUS); if (interstitialModeEnabled) { diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index bcce86f9f9..c358df746b 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -91,9 +91,7 @@ void SafeLanding::finishSequence(int first, int last) { void SafeLanding::addToSequence(int sequenceNumber) { Locker lock(_lock); - if (_trackingEntities) { - _sequenceNumbers.insert(sequenceNumber); - } + _sequenceNumbers.insert(sequenceNumber); } void SafeLanding::updateTracking() {