File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -582,7 +582,14 @@ namespace ammonite {
582582
583583 const Path& cameraPath = pathTrackerMap[pathId];
584584 const PathNode& maxNode = cameraPath.pathNodes [(cameraPath.pathNodes .size () - 1 )];
585- return std::min (cameraPath.currentTime , maxNode.time );
585+
586+ // Loop the time value for the loop mod
587+ double cameraPathTime = cameraPath.currentTime ;
588+ if (cameraPath.pathMode == AMMONITE_PATH_LOOP) {
589+ cameraPathTime = std::fmod (cameraPathTime, maxNode.time );
590+ }
591+
592+ return std::min (cameraPathTime, maxNode.time );
586593 }
587594
588595 // Return the current progress, relative to 1.0 as the end
@@ -595,7 +602,14 @@ namespace ammonite {
595602
596603 const Path& cameraPath = pathTrackerMap[pathId];
597604 const PathNode& maxNode = cameraPath.pathNodes [(cameraPath.pathNodes .size () - 1 )];
598- const double progress = cameraPath.currentTime / maxNode.time ;
605+
606+ // Loop the time value for the loop mod
607+ double cameraPathTime = cameraPath.currentTime ;
608+ if (cameraPath.pathMode == AMMONITE_PATH_LOOP) {
609+ cameraPathTime = std::fmod (cameraPathTime, maxNode.time );
610+ }
611+
612+ const double progress = cameraPathTime / maxNode.time ;
599613 return std::min (progress, 1.0 );
600614 }
601615
You can’t perform that action at this time.
0 commit comments