1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-05-11 09:32:05 +00:00

ru:: pendulum and ellipse platforms now take shift into account

This commit is contained in:
Zeno Rogue
2026-03-31 15:51:12 +02:00
parent d10d53ee7d
commit cb88e9deff
+2 -2
View File
@@ -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);