synchronize time over parallel connection

This commit is contained in:
Emil Axelsson
2016-09-22 18:42:19 +02:00
parent fa8eee5386
commit 112fe7fc54
8 changed files with 332 additions and 274 deletions

View File

@@ -45,6 +45,7 @@
#include <openspace/scene/scene.h>
#include <openspace/util/factorymanager.h>
#include <openspace/util/time.h>
#include <openspace/util/timemanager.h>
#include <openspace/util/spicemanager.h>
#include <openspace/util/syncbuffer.h>
#include <openspace/util/transformationmanager.h>
@@ -130,6 +131,7 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName,
, _console(new LuaConsole)
, _moduleEngine(new ModuleEngine)
, _settingsEngine(new SettingsEngine)
, _timeManager(new TimeManager)
, _downloadManager(nullptr)
#ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED
, _gui(new gui::GUI)
@@ -144,6 +146,7 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName,
, _shutdownCountdown(0.f)
, _shutdownWait(0.f)
{
_interactionHandler->setPropertyOwner(_globalPropertyNamespace.get());
_globalPropertyNamespace->addPropertySubOwner(_interactionHandler.get());
_globalPropertyNamespace->addPropertySubOwner(_settingsEngine.get());
@@ -749,9 +752,7 @@ void OpenSpaceEngine::preSynchronization() {
FileSys.triggerFilesystemEvents();
if (_isMaster) {
double dt = _windowWrapper->averageDeltaTime();
Time::ref().advanceTime(dt);
Time::ref().preSynchronization();
_timeManager->preSynchronization(dt);
_scriptEngine->preSynchronization();
@@ -1063,5 +1064,10 @@ DownloadManager& OpenSpaceEngine::downloadManager() {
return *_downloadManager;
}
TimeManager& OpenSpaceEngine::timeManager() {
ghoul_assert(_timeManager, "Download Manager must not be nullptr");
return *_timeManager;
}
} // namespace openspace