From ca2ed9f5f4ad44e27162712a7376aaaef1290925 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 16 Feb 2021 19:28:30 +0000 Subject: Tidy code for calculating position of rail vehicle by bogeys --- game/vehicles/railloco.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'game/vehicles/railloco.h') 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; @@ -28,6 +28,9 @@ public: std::vector wagons; private: + void move(TickDuration dur); + Transform getBogeyPosition(float linkDist, float dist) const; + void updateRailVehiclePosition(RailVehicle *, float trailBy) const; void updateWagons() const; }; -- cgit v1.2.3