History

first cut at local voxel cache

Brad Hefta-Gaub committed 12 years ago

Commit c181d0a1 parent 03794f79 files · +416 −344Browse files

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

Unified · Split

interface/src/Application.cpp+20−1
@@ -86,6 +86,8 @@ const float MIRROR_FULLSCREEN_DISTANCE = 0.35f; · 85 unmodified lines
8686 const float MIRROR_REARVIEW_DISTANCE = 0.65f;
8787 const float MIRROR_REARVIEW_BODY_DISTANCE = 2.3f;
8888
89+const char* LOCAL_VOXEL_CACHE = "/Users/brad/local_voxel_cache.svo";
90+
8991
9092 void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) {
9193 fprintf(stdout, "%s", message.toLocal8Bit().constData());
@@ -143,7 +145,8 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 51 unmodified lines
143145 _resetRecentMaxPacketsSoon(true),
144146 _swatch(NULL),
145147 _pasteMode(false),
146− _logger(new FileLogger())
148+ _logger(new FileLogger()),
149+ _persistThread(NULL)
147150 {
148151 _applicationStartupTime = startup_time;
149152
@@ -250,6 +253,14 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 100 unmodified lines
250253
251254 // Set the sixense filtering
252255 _sixenseManager.setFilter(Menu::getInstance()->isOptionChecked(MenuOption::FilterSixense));
256+
257+ _persistThread = new OctreePersistThread(_voxels.getTree(), LOCAL_VOXEL_CACHE);
258+
259+ if (_persistThread) {
260+ _voxels.beginLoadingLocalVoxelCache(); // while local voxels are importing, don't do individual node VBO updates
261+ connect(_persistThread, SIGNAL(loadCompleted()), &_voxels, SLOT(localVoxelCacheLoaded()));
262+ _persistThread->initialize(true);
263+ }
253264 }
254265
255266 Application::~Application() {
@@ -1436,6 +1447,8 @@ void Application::terminate() { · 1180 unmodified lines
14361447 _voxelHideShowThread.terminate();
14371448 _voxelEditSender.terminate();
14381449 _particleEditSender.terminate();
1450+ _persistThread->terminate();
1451+ _persistThread = NULL;
14391452 }
14401453
14411454 static Avatar* processAvatarMessageHeader(unsigned char*& packetData, size_t& dataBytes) {
@@ -2400,6 +2413,7 @@ void Application::updateThreads(float deltaTime) { · 958 unmodified lines
24002413 _voxelHideShowThread.threadRoutine();
24012414 _voxelEditSender.threadRoutine();
24022415 _particleEditSender.threadRoutine();
2416+ _persistThread->threadRoutine();
24032417 }
24042418 }
24052419
@@ -4536,3 +4550,8 @@ void Application::toggleLogDialog() { · 2130 unmodified lines
45364550 _logDialog->close();
45374551 }
45384552 }
4553+
4554+
4555+void Application::initAvatarAndViewFrustum() {
4556+ updateAvatar(0.f);
4557+}

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