mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Feature/time interpolation (#669)
* Initial implementation * Better approximation of target time * Correctly use double precision for time passing * Cleanup * Adding proportional adjustment of delta time at end of interpolation * Keyframe based time interpolation * Add property for time interpolation duration. Move time interpolation methods to TimeManager. * Fix bugs with time gui * Make several clicks on delta time buttons work as expected * Clean up * Improve time interpolation for parallel connection * Improve time API. Fix time interpolation bugs. * Fix mac compile issue * Add hour button * Add missing + sign * Remove newer images from projection buffer when going back in time * Add comment about clearing projection buffer * Fix bug with jumping time in parallel connection * Rename integrateFromTime to previousFrameTime * Compile fix for iswa module * Address code review comments * Code cleanup * Fix bug causig unsmooth behaviour when pausing while interpolating in time
This commit is contained in:
@@ -177,7 +177,7 @@ DashboardItemSimulationIncrement::DashboardItemSimulationIncrement(
|
||||
}
|
||||
|
||||
void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) {
|
||||
const double t = OsEng.timeManager().time().deltaTime();
|
||||
const double t = OsEng.timeManager().targetDeltaTime();
|
||||
std::pair<double, std::string> deltaTime;
|
||||
if (_doSimplification) {
|
||||
deltaTime = simplifyTime(t);
|
||||
@@ -188,19 +188,22 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) {
|
||||
deltaTime = { convertedT, nameForTimeUnit(unit, convertedT != 1.0) };
|
||||
}
|
||||
|
||||
std::string pauseText = OsEng.timeManager().isPaused() ? " (Paused)" : "";
|
||||
|
||||
penPosition.y -= _font->height();
|
||||
RenderFont(
|
||||
*_font,
|
||||
penPosition,
|
||||
fmt::format(
|
||||
"Simulation increment: {:.1f} {:s} / second",
|
||||
deltaTime.first, deltaTime.second
|
||||
"Simulation increment: {:.1f} {:s} / second{:s}",
|
||||
deltaTime.first, deltaTime.second,
|
||||
pauseText
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
glm::vec2 DashboardItemSimulationIncrement::size() const {
|
||||
double t = OsEng.timeManager().time().deltaTime();
|
||||
double t = OsEng.timeManager().targetDeltaTime();
|
||||
std::pair<double, std::string> deltaTime;
|
||||
if (_doSimplification) {
|
||||
deltaTime = simplifyTime(t);
|
||||
|
||||
Reference in New Issue
Block a user