summaryrefslogtreecommitdiff
path: root/game/vehicles/railloco.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-02-16 19:28:30 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-02-16 19:28:30 +0000
commitca2ed9f5f4ad44e27162712a7376aaaef1290925 (patch)
tree87ccb21e20d97f13a2dbcca2434b694e5066dc28 /game/vehicles/railloco.h
parentRename types in LinkHistory (diff)
downloadilt-ca2ed9f5f4ad44e27162712a7376aaaef1290925.tar.bz2
ilt-ca2ed9f5f4ad44e27162712a7376aaaef1290925.tar.xz
ilt-ca2ed9f5f4ad44e27162712a7376aaaef1290925.zip
Tidy code for calculating position of rail vehicle by bogeys
Diffstat (limited to 'game/vehicles/railloco.h')
-rw-r--r--game/vehicles/railloco.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/game/vehicles/railloco.h b/game/vehicles/railloco.h
index 537d448..ce4012a 100644
--- a/game/vehicles/railloco.h
+++ b/game/vehicles/railloco.h
@@ -10,13 +10,13 @@ public:
using Vehicle::Vehicle;
float wheelBase;
float length;
+ friend class RailLoco;
};
class RailWagon : public RailVehicle {
public:
using RailVehicle::RailVehicle;
void tick(TickDuration elapsed) override;
- friend class RailLoco;
};
using RailWagonPtr = std::weak_ptr<RailWagon>;
@@ -28,6 +28,9 @@ public:
std::vector<RailWagonPtr> wagons;
private:
+ void move(TickDuration dur);
+ Transform getBogeyPosition(float linkDist, float dist) const;
+ void updateRailVehiclePosition(RailVehicle *, float trailBy) const;
void updateWagons() const;
};