Showing the changes to interface/src/Application.cpp (1 of 9 files). Show all
Unified · Split
| @@ -86,6 +86,8 @@ const float MIRROR_FULLSCREEN_DISTANCE = 0.35f; · 85 unmodified lines | ||
| 86 | 86 | const float MIRROR_REARVIEW_DISTANCE = 0.65f; |
| 87 | 87 | const float MIRROR_REARVIEW_BODY_DISTANCE = 2.3f; |
| 88 | 88 | |
| 89 | +const char* LOCAL_VOXEL_CACHE = "/Users/brad/local_voxel_cache.svo"; | |
| 90 | + | |
| 89 | 91 | |
| 90 | 92 | void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) { |
| 91 | 93 | fprintf(stdout, "%s", message.toLocal8Bit().constData()); |
| @@ -143,7 +145,8 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 51 unmodified lines | ||
| 143 | 145 | _resetRecentMaxPacketsSoon(true), |
| 144 | 146 | _swatch(NULL), |
| 145 | 147 | _pasteMode(false), |
| 146 | − _logger(new FileLogger()) | |
| 148 | + _logger(new FileLogger()), | |
| 149 | + _persistThread(NULL) | |
| 147 | 150 | { |
| 148 | 151 | _applicationStartupTime = startup_time; |
| 149 | 152 | |
| @@ -250,6 +253,14 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 100 unmodified lines | ||
| 250 | 253 | |
| 251 | 254 | // Set the sixense filtering |
| 252 | 255 | _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 | + } | |
| 253 | 264 | } |
| 254 | 265 | |
| 255 | 266 | Application::~Application() { |
| @@ -1436,6 +1447,8 @@ void Application::terminate() { · 1180 unmodified lines | ||
| 1436 | 1447 | _voxelHideShowThread.terminate(); |
| 1437 | 1448 | _voxelEditSender.terminate(); |
| 1438 | 1449 | _particleEditSender.terminate(); |
| 1450 | + _persistThread->terminate(); | |
| 1451 | + _persistThread = NULL; | |
| 1439 | 1452 | } |
| 1440 | 1453 | |
| 1441 | 1454 | static Avatar* processAvatarMessageHeader(unsigned char*& packetData, size_t& dataBytes) { |
| @@ -2400,6 +2413,7 @@ void Application::updateThreads(float deltaTime) { · 958 unmodified lines | ||
| 2400 | 2413 | _voxelHideShowThread.threadRoutine(); |
| 2401 | 2414 | _voxelEditSender.threadRoutine(); |
| 2402 | 2415 | _particleEditSender.threadRoutine(); |
| 2416 | + _persistThread->threadRoutine(); | |
| 2403 | 2417 | } |
| 2404 | 2418 | } |
| 2405 | 2419 | |
| @@ -4536,3 +4550,8 @@ void Application::toggleLogDialog() { · 2130 unmodified lines | ||
| 4536 | 4550 | _logDialog->close(); |
| 4537 | 4551 | } |
| 4538 | 4552 | } |
| 4553 | + | |
| 4554 | + | |
| 4555 | +void Application::initAvatarAndViewFrustum() { | |
| 4556 | + updateAvatar(0.f); | |
| 4557 | +} | |