18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 09:27:10 +01:00

docs(agents): the components of the vehicle, what concerns a consist, and what the renderer reads

AGENTS.md says how a part of physics::Vehicle is written (a public config from
the .fiz, the state private behind queries and operations, its own logic fed
with plain values, ...ForTest() for the tests), that what concerns a consist
works on its vehicles given in order rather than on TDynamicObject, and that
the renderer and the rest outside physics/ and vehicle/ read a vehicle through
TDynamicObject.
This commit is contained in:
2026-11-29 11:01:48 +01:00
parent ea7a770d6c
commit 7387e36df5
+12
View File
@@ -118,6 +118,18 @@ couplers, collisions, derailment) and `vehicle/` (the vehicle in the scenery, th
- The commands between the vehicles are `VehicleCommand` (`physics/vehiclecommand.h`); their text names only matter where a command
comes as text.
- What depends on the kind of drive (`EngineType`) goes into its class in `physics/components/drive.*`, not into a new `switch`.
- The parts of `physics::Vehicle` are components, as `physics/components/maincircuit.h`, `lowvoltage.h`, `pantographs.h` and
`airsupply.h` show: what the `.fiz` defines is in their public `config`, written only by the parser and the setup of the vehicle;
their state is private, read through queries and changed through operations named after what happens (`Close()`,
`ResetGround()`, `Switch()`). The logic that concerns only a part is its own (`Update()` of the converter, of the compressor, of
the air of the pantographs), and the vehicle hands it what it needs as plain values (`ConverterSupply`, `CompressorInputs`) rather
than a `physics::Vehicle &`. The vehicle decides when a part acts and follows up what a step of it reports. A test that sets a
state directly uses the `...ForTest()` operation of the part, never a back door in the game's code. A new part follows the same
pattern, and a part being worked on moves to it.
- What concerns a consist rather than a vehicle works on the vehicles of the consist given to it in their order
(`physics::ConsistBrakeBlending`), not on `TDynamicObject`, so that it can be tested without the scenery.
- The renderer and the rest of the simulator outside `physics/` and `vehicle/` read a vehicle through `TDynamicObject` (its
dimensions, speed, active cab, lights), not through `physics/vehicle.h`.
## Renderers: the move to OpenGL 4.6 and Vulkan