History

Merge branch 'master' of https://github.com/highfidelity/hifi into blue

samcake committed 9 years ago

Commit 225d2bb2 parents 395d7c3 fb5fd3440 files · +1459 −444Browse files

Showing the changes to interface/src/Application.cpp (1 of 40 files). Show all

Unified · Split

interface/src/Application.cpp+8−32
@@ -4749,12 +4749,8 @@ void Application::resetPhysicsReadyInformation() { · 4748 unmodified lines
47494749
47504750 void Application::reloadResourceCaches() {
47514751 resetPhysicsReadyInformation();
4752− {
4753− QMutexLocker viewLocker(&_viewMutex);
4754− _viewFrustum.setPosition(glm::vec3(0.0f, 0.0f, TREE_SCALE));
4755− _viewFrustum.setOrientation(glm::quat());
4756− }
4757− // Clear entities out of view frustum
4752+ // Query the octree to refresh everything in view
4753+ _lastQueriedTime = 0;
47584754 queryOctree(NodeType::EntityServer, PacketType::EntityQuery, _entityServerJurisdictions);
47594755
47604756 DependencyManager::get<AssetClient>()->clearCache();
@@ -4912,13 +4908,9 @@ void Application::update(float deltaTime) { · 151 unmodified lines
49124908 // we haven't yet enabled physics. we wait until we think we have all the collision information
49134909 // for nearby entities before starting bullet up.
49144910 quint64 now = usecTimestampNow();
4915− bool timeout = false;
49164911 const int PHYSICS_CHECK_TIMEOUT = 2 * USECS_PER_SECOND;
4917− if (_lastPhysicsCheckTime > 0 && now - _lastPhysicsCheckTime > PHYSICS_CHECK_TIMEOUT) {
4918− timeout = true;
4919− }
49204912
4921− if (timeout || _fullSceneReceivedCounter > _fullSceneCounterAtLastPhysicsCheck) {
4913+ if (now - _lastPhysicsCheckTime > PHYSICS_CHECK_TIMEOUT || _fullSceneReceivedCounter > _fullSceneCounterAtLastPhysicsCheck) {
49224914 // we've received a new full-scene octree stats packet, or it's been long enough to try again anyway
49234915 _lastPhysicsCheckTime = now;
49244916 _fullSceneCounterAtLastPhysicsCheck = _fullSceneReceivedCounter;
@@ -5470,7 +5462,7 @@ int Application::sendNackPackets() { · 545 unmodified lines
54705462 return packetsSent;
54715463 }
54725464
5473−void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions, bool forceResend) {
5465+void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) {
54745466
54755467 if (!_settingsLoaded) {
54765468 return; // bail early if settings are not loaded
@@ -5626,16 +5618,6 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 149 unmodified lines
56265618 _octreeQuery.setMaxQueryPacketsPerSecond(0);
56275619 }
56285620
5629− // if asked to forceResend, then set the query's position/orientation to be degenerate in a manner
5630− // that will cause our next query to be guarenteed to be different and the server will resend to us
5631− if (forceResend) {
5632− _octreeQuery.setCameraPosition(glm::vec3(-0.1, -0.1, -0.1));
5633− const glm::quat OFF_IN_NEGATIVE_SPACE = glm::quat(-0.5, 0, -0.5, 1.0);
5634− _octreeQuery.setCameraOrientation(OFF_IN_NEGATIVE_SPACE);
5635− _octreeQuery.setCameraNearClip(0.1f);
5636− _octreeQuery.setCameraFarClip(0.1f);
5637− }
5638−
56395621 // encode the query data
56405622 int packetSize = _octreeQuery.getBroadcastData(reinterpret_cast<unsigned char*>(queryPacket->getPayload()));
56415623 queryPacket->setPayloadSize(packetSize);
@@ -5870,8 +5852,6 @@ void Application::clearDomainOctreeDetails() { · 228 unmodified lines
58705852
58715853 skyStage->setBackgroundMode(model::SunSkyStage::SKY_DEFAULT);
58725854
5873− _recentlyClearedDomain = true;
5874−
58755855 DependencyManager::get<AnimationCache>()->clearUnusedResources();
58765856 DependencyManager::get<ModelCache>()->clearUnusedResources();
58775857 DependencyManager::get<SoundCache>()->clearUnusedResources();
@@ -5918,14 +5898,10 @@ void Application::nodeActivated(SharedNodePointer node) { · 40 unmodified lines
59185898 }
59195899 }
59205900
5921− // If we get a new EntityServer activated, do a "forceRedraw" query. This will send a degenerate
5922− // query so that the server will think our next non-degenerate query is "different enough" to send
5923− // us a full scene
5924− if (_recentlyClearedDomain && node->getType() == NodeType::EntityServer) {
5925− _recentlyClearedDomain = false;
5926− if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
5927− queryOctree(NodeType::EntityServer, PacketType::EntityQuery, _entityServerJurisdictions, true);
5928− }
5901+ // If we get a new EntityServer activated, reset lastQueried time
5902+ // so we will do a proper query during update
5903+ if (node->getType() == NodeType::EntityServer) {
5904+ _lastQueriedTime = 0;
59295905 }
59305906
59315907 if (node->getType() == NodeType::AudioMixer) {