From cb88e9deff5069ec861c07e77a7845320de5ae45 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 31 Mar 2026 15:51:12 +0200 Subject: [PATCH] ru:: pendulum and ellipse platforms now take shift into account --- rogueviz/ru/entity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rogueviz/ru/entity.cpp b/rogueviz/ru/entity.cpp index 7719643d..dfd6f57e 100644 --- a/rogueviz/ru/entity.cpp +++ b/rogueviz/ru/entity.cpp @@ -619,7 +619,7 @@ xy pendulum_platform::location_at(ld t) { auto h1 = to_hyper(a); auto h2 = to_hyper(b); auto d = hdist(h1, h2); - auto x = (1 - cos(t / game_fps * TAU / period)) / 2 * d; + auto x = (1 - cos(shift + t / game_fps * TAU / period)) / 2 * d; return from_hyper(rgpushxto0(h1) * rspintox(gpushxto0(h1) * h2) * xpush0(x)); } @@ -643,7 +643,7 @@ xy ellipse_platform::location_at(ld t) { } lengthsum.push_back(ls); } - ld our_t = t / (period * game_fps); + ld our_t = (t + shift * game_fps) / (period * game_fps); our_t -= floor(our_t); our_t *= lengthsum.back(); auto it = lower_bound(lengthsum.begin(), lengthsum.end(), our_t);