From 272c5a716966cb25c74235022b5fbc1460638535 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 11 Jul 2026 23:38:43 +0200 Subject: [PATCH] Tourismustal: Biker fahren richtig herum (Flip statt Vollrotation) Bildschirm-Winkel bergab ist ~140 Grad - volle Rotation stellte die Fahrer auf den Kopf bzw. aufs Vorderrad. Jetzt: Spiegelung nach Fahrtrichtung + leichte Bergab-Neigung (Faktor 0.3). Co-Authored-By: Claude Opus 4.8 (1M context) --- App/sims/tourismustal/js/iso.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/App/sims/tourismustal/js/iso.js b/App/sims/tourismustal/js/iso.js index ec54fcd..56c8ae5 100644 --- a/App/sims/tourismustal/js/iso.js +++ b/App/sims/tourismustal/js/iso.js @@ -1415,12 +1415,16 @@ export class IsoRenderer { const fi = pr * segs; const i0 = Math.min(segs - 1, Math.floor(fi)); const f = fi - i0; - const bx = pts[i0].x + (pts[i0 + 1].x - pts[i0].x) * f; - const by = pts[i0].y + (pts[i0 + 1].y - pts[i0].y) * f - 4; - const ang = Math.atan2(pts[i0 + 1].y - pts[i0].y, pts[i0 + 1].x - pts[i0].x); + const sdx = pts[i0 + 1].x - pts[i0].x; + const sdy = pts[i0 + 1].y - pts[i0].y; + const bx = pts[i0].x + sdx * f; + const by = pts[i0].y + sdy * f - 4; ctx.save(); ctx.translate(bx, by); - ctx.rotate(ang * 0.45); + // Blickrichtung: Rad zeigt in Fahrtrichtung (spiegeln statt rotieren), + // dazu nur eine LEICHTE Bergab-Neigung – sonst stehen sie kopf. + ctx.scale(sdx < 0 ? -1 : 1, 1); + ctx.rotate(Math.atan2(sdy, Math.abs(sdx) || 0.01) * 0.3); // Räder ctx.strokeStyle = '#2f3e46'; ctx.lineWidth = 1.1; ctx.beginPath(); ctx.arc(-3.2, 1.5, 2.1, 0, 7); ctx.stroke();