Skip to content

Add the throttle to the golden_line example - #356

Merged
ASDAlexander77 merged 1 commit into
mainfrom
golden-line-throttle
Dec 5, 2026
Merged

ASDAlexander77 merged 1 commit into
mainfrom
golden-line-throttle

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Summary

  • This PR adds the original's throttle to the golden_line example (controls.js and main.js's step).
    • Keys: W and S speed the train up or slow it down by 7.5 m/s every second while held, between 0 and 36 m/s.
    • Panel: a new "Speed (km/h)" slider shows the speed (hud.js's gauge) and sets it when dragged. It is clamped like main.js's setSpeed.
    • Command line: -speed <m/s> starts the ride at that speed, as the original's composeNow speed option does.
  • Live speed: the train (wheels, rods), its steam and the cameras now follow the live speed instead of the fixed cruise speed.
  • Held train: a train held still with -trainz keeps its shot at speed 0, as before.

Verification

  • Against the original: composed drone and trackside "pass" shots at 6 and 30 m/s put the train and the camera where the page does (page captures with { ..., speed }). At 6 m/s both show the drain-cock puffs.
  • Builds: gc, own and rc render byte-identical frames.
  • Frames vs main: the daytime views change only inside the panel, where the new slider row is. The dusk presets with -noui are byte-identical to main.
  • Tests: ctest -R golden_line passes 6/6.

Known

  • Keys not pressed live: W/S were not pressed in a live window; tests run headless only. They drive the same setSpeed path as -speed.
  • Plume shape: the plume's shape differs from the page's at every speed, including the default 18 m/s. It is a pre-existing difference in the plume's history, not caused by the speed.
  • Not ported yet: photo mode (with the HUD) and the sound.

🤖 Generated with Claude Code

W and S speed the train up or slow it down while held (controls.js's
throttle: 7.5 m/s every second, 0 to 36 m/s). The panel shows the speed
in km/h and can set it, and -speed <m/s> starts the ride at it
(composeNow's speed). The train, its steam and the cameras follow the
live speed instead of the fixed cruise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit a90213e into main Dec 5, 2026
2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the golden-line-throttle branch December 5, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant