Expand description
Trains.
Trains are position-less entities, simply storing a vector of references to their carriages (and, currently, an acceleration and velocity).
Carriages are also track position-less entities. Each has a certain length, width and mass. They have a system of bogies, to which they position themselves.
Bogies have both a track position and a world transform. On each frame, after bogie world transforms are updated based on their track positions, carriages are aligned respective to their bogies.
Modules§
Structs§
- Bogie
- A bogie.
- Carriage
- A single carriage in a train, defined by its length, width and mass.
- Train
- Train
Member - Component of a carriage, pointing to its parent train.
Enums§
- Carriage
Bogies - Describes which shape a carriage’s bogies can take. For simplicity sake, it is assumed that bogies are mounted at the same location on each carriage.
- Train
Mode - Defines the behaviour of the related train. Unfinished.
Constants§
- BRAKING_
COEFF - COUPLER_
LENGTH - Default coupler length. This should become a modifiable property in the future.
- DOUBLE_
BOGIE_ IDX - Where should the double bogie be mounted. This should become a modifiable property in the future.
- SINGLE_
BOGIE_ IDX - Where should the single bogie be mounted. This should become a modifiable property in the future.
Functions§
- on_
carriage_ press_ window - Observer that runs on left click on carriages and opens the train window