18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-27 23:57:09 +01:00
Files
maszyna/tests/unit/test_camera_views.cpp
jerrrrycho 795883335d feat: orbit, shunting, coupling and trackside views of the train (eu07/maszyna#551)
[Shift]+[F4] goes on after the four views it had (front of the train, its rear,
a bogie, drive-by) to four views that go with one vehicle of the train:

- orbit: around the middle of the vehicle. Left/right arrows (and the mouse)
  turn the camera around it, up/down arrows bring it closer and further
  (from outside the body to 250 m), PgUp/PgDn (and the mouse) raise and
  lower it; it never goes below 0.5 m above the rails. It turns with the
  vehicle.
- shunting: straight down from above the vehicle, the way the user drives up
  the screen, going with it. Arrows move it along and across the train,
  PgUp/PgDn up and down (from above the roof to 300 m).
- coupling: low beside a coupler, looking at it. At an end of the train with
  another vehicle (not coupled) closer than 150 m, it starts at that end and
  steps back from the track as the gap grows, looking between the two
  couplers. Left/right arrows pick the side of the track, up/down the
  distance, PgUp/PgDn the height.
- trackside: a railfan beside the line ahead of the train, looking at the
  vehicle picked as the train comes and goes by. Once its tail is 40 m past
  (or the train is 1 km away) the railfan walks to a new spot ahead, 15 s of
  the train's run away (80-500 m, along the curve of the line), on the other
  side of the track.

[ and ] pick the vehicle the view goes with (the coupling, in the coupling
view), towards the front and the rear of the train; the view starts with the
vehicle the user drives. [ and ] are bound to nothing by default nor in the
shipped eu07_input-keyboard.ini; [Ctrl]+[ / ] stay the debug train moves.

The camera follows from pure functions in vehicle/cameraviews.cpp (eu07_core),
tested in tests/unit/test_camera_views.cpp; application/consistviews.cpp hands
them the vehicles of the train and keeps what the user set. The four older
views and their order don't change. "consistviews no" in eu07.ini keeps the
cycle of [Shift]+[F4] to the four older views. The black box writes the new
views as 4-7 (blackbox_doc.md).
2026-11-17 02:30:55 +01:00

18 KiB