]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIAircraft.hxx
Make the scenerio's work again (now for real) and a small number of updates.
[flightgear.git] / src / AIModel / AIAircraft.hxx
index 8d16f381e57136aa1134af72c1dad05750d40c30..33cf99e5e4e402c5964def17eec688fb7bd11cf2 100644 (file)
@@ -46,10 +46,10 @@ private:
        
 public:
 
-        enum aircraft_e {LIGHT=0, WW2_FIGHTER, JET_TRANSPORT, JET_FIGHTER};
+        enum aircraft_e {LIGHT=0, WW2_FIGHTER, JET_TRANSPORT, JET_FIGHTER, TANKER};
         static const PERF_STRUCT settings[];
        
-       FGAIAircraft();
+       FGAIAircraft(FGAIManager* mgr);
        ~FGAIAircraft();
        
        bool init();
@@ -58,37 +58,34 @@ public:
        void update(double dt);
 
         void SetPerformance(const PERF_STRUCT *ps);
+        void SetFlightPlan(FGAIFlightPlan *f);
         void AccelTo(double speed);
         void PitchTo(double angle);
         void RollTo(double angle);
         void YawTo(double angle);
         void ClimbTo(double altitude);
         void TurnTo(double heading);
+        void ProcessFlightPlan( double dt );
+
+        inline void SetTanker(bool setting) { isTanker = setting; };
 
-protected:
-        static FGAIAircraft *_self;
-       
 private:
 
         bool hdg_lock;
         bool alt_lock;
-
+        double dt_count;  
         double dt; 
 
         const PERF_STRUCT *performance;
+        bool use_perf_vs;
+        SGPropertyNode* refuel_node;
+        bool isTanker;
 
        void Run(double dt);
         double sign(double x); 
 
-        static bool _getGearDown();
+        bool _getGearDown() const;
 };
 
-inline bool FGAIAircraft::_getGearDown() {
-    return ((fgGetFloat("/position/altitude-agl-ft") < 150.0)
-             && (fgGetFloat("/orientation/pitch-deg") < 0.0)
-             && (fgGetFloat("/velocities/airspeed-kt")
-                   < _self->performance->land_speed*1.5));
-}
-
 
 #endif  // _FG_AIAircraft_HXX