X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAIShip.hxx;h=34038db90200615172e7dc20d3f0ba739096e6d1;hb=afcdbd3158503773644aa07dd86cd92d67946bd4;hp=cf7f6c404e5045d7d54acd5c36fbb3f38c4cea13;hpb=a6db6d89ff41a619569e6433409e8bf62ff98499;p=flightgear.git diff --git a/src/AIModel/AIShip.hxx b/src/AIModel/AIShip.hxx index cf7f6c404..34038db90 100644 --- a/src/AIModel/AIShip.hxx +++ b/src/AIModel/AIShip.hxx @@ -39,10 +39,10 @@ public: virtual bool init(bool search_in_AI_path=false); virtual void bind(); - virtual void unbind(); virtual void update(double dt); + virtual void reinit(); + void setFlightPlan(FGAIFlightPlan* f); - void setName(const string&); void setRudder(float r); void setRoll(double rl); void ProcessFlightPlan( double dt); @@ -61,48 +61,52 @@ public: void setRudderConstant(double rc); void setSpeedConstant(double sc); void setFixedTurnRadius(double ft); + void setRollFactor(double rf); + + void setTunnel(bool t); + void setInitialTunnel(bool t); + void setWPNames(); + void setWPPos(); + double sign(double x); bool _hdg_lock; bool _serviceable; bool _waiting; bool _new_waypoint; + bool _tunnel, _initial_tunnel; + bool _restart; virtual const char* getTypeString(void) const { return "ship"; } double _rudder_constant, _speed_constant, _hdg_constant, _limit ; double _elevation_m, _elevation_ft; - double _missed_range, _tow_angle, _wait_count; + double _missed_range, _tow_angle, _wait_count, _missed_count,_wp_range; + double _dt_count, _next_run; - FGAIFlightPlan::waypoint* prev; // the one behind you - FGAIFlightPlan::waypoint* curr; // the one ahead - FGAIFlightPlan::waypoint* next; // the next plus 1 + FGAIWaypoint* prev; // the one behind you + FGAIWaypoint* curr; // the one ahead + FGAIWaypoint* next; // the next plus 1 protected: - string _name; // The name of this ship. - private: - - virtual void reinit() { init(); } - void setRepeat(bool r); + void setRestart(bool r); void setMissed(bool m); void setServiceable(bool s); void Run(double dt); void setStartTime(const string&); void setUntilTime(const string&); - void setWPPos(); + //void setWPPos(); void setWPAlt(); void setXTrackError(); SGGeod wppos; - const SGMaterial* _material; - double getRange(double lat, double lon, double lat2, double lon2) const; double getCourse(double lat, double lon, double lat2, double lon2) const; double getDaySeconds(); @@ -115,9 +119,7 @@ private: double _roll_constant, _roll_factor; double _sp_turn_radius_ft, _rd_turn_radius_ft, _fixed_turn_radius; - double _wp_range, _old_range, _range_rate; - double _dt_count, _missed_count; - double _next_run; + double _old_range, _range_rate; double _missed_time_sec; double _start_sec; double _day; @@ -125,6 +127,7 @@ private: double _lead_angle_gain, _lead_angle_limit, _proportion; double _course; double _xtrack_error; + double _curr_alt, _prev_alt; string _prev_name, _curr_name, _next_name; string _path; @@ -133,6 +136,7 @@ private: bool _repeat; bool _fp_init; bool _missed; + };