History

some hacking on full scene debuggin

ZappoMan committed 12 years ago

Commit 4d0b7621 parent 21486644 files · +37 −4Browse files

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

Unified · Split

interface/src/Application.cpp+16−2
@@ -141,6 +141,9 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 140 unmodified lines
141141 _justStarted(true),
142142 _voxelImporter(NULL),
143143 _wantToKillLocalVoxels(false),
144+ _viewFrustum(),
145+ _lastQueriedViewFrustum(),
146+ _lastQueriedTime(usecTimestampNow()),
144147 _audioScope(256, 200, true),
145148 _myAvatar(),
146149 _mirrorViewRect(QRect(MIRROR_VIEW_LEFT_PADDING, MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT)),
@@ -1917,8 +1920,19 @@ void Application::updateMyAvatar(float deltaTime) { · 1770 unmodified lines
19171920 loadViewFrustum(_myCamera, _viewFrustum);
19181921
19191922 // Update my voxel servers with my current voxel query...
1920− queryOctree(NodeType::VoxelServer, PacketTypeVoxelQuery, _voxelServerJurisdictions);
1921− queryOctree(NodeType::ParticleServer, PacketTypeParticleQuery, _particleServerJurisdictions);
1923+ quint64 now = usecTimestampNow();
1924+ const quint64 TOO_LONG_SINCE_LAST_QUERY = 1 * USECS_PER_SECOND;
1925+
1926+ // if we haven't waited long enough and the frustum is similar enough, then surpress this query...
1927+ if ((now - _lastQueriedTime) > TOO_LONG_SINCE_LAST_QUERY || !_lastQueriedViewFrustum.isVerySimilar(_viewFrustum)) {
1928+ _lastQueriedTime = now;
1929+ queryOctree(NodeType::VoxelServer, PacketTypeVoxelQuery, _voxelServerJurisdictions);
1930+ queryOctree(NodeType::ParticleServer, PacketTypeParticleQuery, _particleServerJurisdictions);
1931+ _lastQueriedViewFrustum = _viewFrustum;
1932+ //qDebug() << ">>>>>>>>>> SENDING query...";
1933+ } else {
1934+ //qDebug() << "suppress query...";
1935+ }
19221936 }
19231937
19241938 void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t