From edaf37b260c3c8bc84df6beee4484ede4f6d4bf3 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Mon, 9 Mar 2020 13:52:23 -0400 Subject: [PATCH] Early out if simulation not paused. Also, temporary pause on play, for testing --- modules/autonavigation/autonavigationhandler.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/autonavigation/autonavigationhandler.cpp b/modules/autonavigation/autonavigationhandler.cpp index 87b06a500b..b7ee3ff8d9 100644 --- a/modules/autonavigation/autonavigationhandler.cpp +++ b/modules/autonavigation/autonavigationhandler.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -104,8 +105,6 @@ void AutoNavigationHandler::updateCamera(double deltaTime) { if (!_isPlaying || _pathSegments.empty()) return; - //TODO: early out if simulation time is not stopped. - PathSegment currentSegment = _pathSegments[_currentSegmentIndex]; // compute interpolated camera state @@ -193,6 +192,16 @@ void AutoNavigationHandler::startPath() { LERROR("Cannot start an empty path."); return; } + + // TODO: remove this line at the end of our project. Used to simplify testing + global::timeManager.setPause(true); + + //OBS! Until we can handle simulation time: early out if not paused + if (!global::timeManager.isPaused()) { + LERROR("Simulation time must be paused to run a camera path."); + return; + } + LINFO("Starting path..."); _currentTime = 0.0; _isPlaying = true;