Skip to main content

Module train

Module train 

Source
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§

commands
systems

Structs§

Bogie
A bogie.
Carriage
A single carriage in a train, defined by its length, width and mass.
Train
TrainMember
Component of a carriage, pointing to its parent train.

Enums§

CarriageBogies
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.
TrainMode
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