From 68ca45addf900bcc79650a8afe6593bbac3ab8f1 Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Thu, 5 Nov 2020 14:35:45 +0100 Subject: [PATCH] No longer silently pause the simulation time when starting a camera path And if user unpauses during motion, pause again. --- modules/autonavigation/autonavigationhandler.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/autonavigation/autonavigationhandler.cpp b/modules/autonavigation/autonavigationhandler.cpp index ea5f44955f..e4734a814a 100644 --- a/modules/autonavigation/autonavigationhandler.cpp +++ b/modules/autonavigation/autonavigationhandler.cpp @@ -214,6 +214,12 @@ void AutoNavigationHandler::updateCamera(double deltaTime) { return; } + // If for some reason the time is no longer paused, pause it again + if (!global::timeManager->isPaused()) { + global::timeManager->setPause(true); + LINFO("Cannot start simulation time during camera motion"); + } + std::unique_ptr ¤tSegment = _pathSegments[_currentSegmentIndex]; CameraPose newPose = currentSegment->traversePath(deltaTime); @@ -307,9 +313,6 @@ void AutoNavigationHandler::startPath() { "Must have exactly one stop entry between every segment." ); - // 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.");