OpenTTD Source: GroundVehicleCache Struct Reference

OpenTTD Source 14.1

Data Fields
GroundVehicleCache Struct Reference

Cached, frequently calculated values. More...

`#include <ground_vehicle.hpp>`

## Data Fields
uint32_t | cached_weight
| Total weight of the consist (valid only for the first engine).
uint32_t | cached_slope_resistance
| Resistance caused by weight when this vehicle part is at a slope.
uint32_t | cached_max_te
| Maximum tractive effort of consist (valid only for the first engine).
uint16_t | cached_axle_resistance
| Resistance caused by the axles of the vehicle (valid only for the first engine).
uint16_t | cached_max_track_speed
| Maximum consist speed (in internal units) limited by track type (valid only for the first engine).
uint32_t | cached_power
| Total power of the consist (valid only for the first engine).
uint32_t | cached_air_drag
| Air drag coefficient of the vehicle (valid only for the first engine).
uint16_t | cached_total_length
| Length of the whole vehicle (valid only for the first engine).
EngineID | first_engine
| Cached EngineID of the front vehicle. INVALID_ENGINE for the front vehicle itself.
uint8_t | cached_veh_length
| Length of this vehicle in units of 1/VEHICLE_LENGTH of normal length. It is cached because this can be set by a callback.
uint16_t | last_speed
| The last speed we did display, so we only have to redraw when this changes.

## Detailed Description

Cached, frequently calculated values.

All of these values except cached_slope_resistance are set only for the first part of a vehicle.

Definition at line 29 of file ground_vehicle.hpp.

The documentation for this struct was generated from the following file:

- src/ground_vehicle.hpp