diff --git a/include/openspace/util/timeline.h b/include/openspace/util/timeline.h index 60e71f25cc..1a9820d4be 100644 --- a/include/openspace/util/timeline.h +++ b/include/openspace/util/timeline.h @@ -95,6 +95,16 @@ bool compareTimeWithKeyframeTime(double a, const KeyframeBase& b); */ bool compareKeyframeTimeWithTime(const KeyframeBase& a, double b); +/** +* Return true if the timestamp of a is smaller than or equal to b. +* This is used only in the mode of saving render frames during session recording +* playback. This was necessary to correct a small timing issue caused by fixing +* the application time according to the playback framerate. In normal operation, +* the application time at the instant the keyframes are evaluated is always a +* little bit newer than the first keyframe in the timeline. +*/ +bool compareKeyframeTimeWithTime_playbackWithFrames(const KeyframeBase& a, double b); + } // namespace openspace #include "timeline.inl" diff --git a/include/openspace/util/timemanager.h b/include/openspace/util/timemanager.h index a67bcef09b..5914841073 100644 --- a/include/openspace/util/timemanager.h +++ b/include/openspace/util/timemanager.h @@ -121,13 +121,14 @@ public: private: void progressTime(double dt); - void applyKeyframeData(const TimeKeyframeData& keyframe); + void applyKeyframeData(const TimeKeyframeData& keyframe, double dt); TimeKeyframeData interpolate(const Keyframe& past, const Keyframe& future, double time); void addDeltaTimesKeybindings(); void clearDeltaTimesKeybindings(); double currentApplicationTimeForInterpolation() const; + double previousApplicationTimeForInterpolation() const; Timeline _timeline; SyncData