]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/simplephysics.h
Change the control system to separate speed and reverse
[r2c2.git] / source / libmarklin / simplephysics.h
index 64d961b1b54f5dbcf3a97491db786ed83d2c2864..5da6bb89d4d58d2942bb2fc23c3e85c9d63d8c63 100644 (file)
@@ -18,6 +18,7 @@ class SimplePhysics: public ControlModel
 {
 private:
        TrainControl target_speed;
+       TrainControl reverse;
        float accel;
        float speed;
 
@@ -28,7 +29,7 @@ public:
        virtual const TrainControl &get_control(const std::string &) const;
 
        virtual float get_speed() const { return speed; }
-       virtual bool get_reverse() const { return speed<0; }
+       virtual bool get_reverse() const { return reverse.value; }
        virtual float get_braking_distance() const;
 
        virtual void tick(const Msp::Time::TimeDelta &);