]> git.mxchange.org Git - flightgear.git/blob - src/AIModel/AIEscort.hxx
Merge commit 'refs/merge-requests/5' of git://gitorious.org/fg/flightgear into next
[flightgear.git] / src / AIModel / AIEscort.hxx
1 // FGAIGroundVehicle - FGAIShip-derived class creates an AI Ground Vehicle
2 // by adding a ground following utility
3 //
4 // Written by Vivian Meazza, started August 2009.
5 // - vivian.meazza at lineone.net
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
21 #ifndef _FG_AIESCORT_HXX
22 #define _FG_AIESCORT_HXX
23
24 #include <string>
25 #include <list>
26
27 #include <simgear/compiler.h>
28
29 #include "AIBase.hxx"
30
31 #include "AIShip.hxx"
32
33 #include "AIManager.hxx"
34 #include "AIBase.hxx"
35
36 class FGAIEscort : public FGAIShip {
37 public:
38     FGAIEscort();
39     virtual ~FGAIEscort();
40
41     virtual void readFromScenario(SGPropertyNode* scFileNode);
42     virtual void bind();
43     virtual void unbind();
44     virtual const char* getTypeString(void) const { return "escort"; }
45
46     bool init(bool search_in_AI_path=false);
47
48 private:
49
50     virtual void reinit() { init(); }
51     virtual void update (double dt);
52
53     void setStnRange(double r);
54     void setStnBrg(double y);
55     void setStationSpeed();
56     void setStnLimit(double l);
57     void setStnAngleLimit(double l);
58     void setStnSpeed(double s);
59     void setStnHtFt(double h);
60     void setStnPatrol(bool p);
61     void setStnDegTrue(bool t);
62     void setParent();
63
64     void setMaxSpeed(double m);
65     void setUpdateInterval(double i);
66
67     void RunEscort(double dt);
68
69     bool getGroundElev(SGGeod inpos);
70
71     SGVec3d getCartHitchPosAt(const SGVec3d& off) const;
72
73     void calcRangeBearing(double lat, double lon, double lat2, double lon2,
74         double &range, double &bearing) const;
75     double calcTrueBearingDeg(double bearing, double heading);
76
77     SGGeod _selectedpos;
78     SGGeod _tgtpos;
79
80     bool   _solid;           // if true ground is solid for FDMs
81     double _load_resistance; // ground load resistanc N/m^2
82     double _frictionFactor;  // dimensionless modifier for Coefficient of Friction
83     double _tgtrange, _tgtbrg;
84     double _ht_agl_ft;
85     double _relbrg, _truebrg;
86     double _parent_speed, _parent_hdg;
87     double _interval;
88
89     double _stn_relbrg, _stn_truebrg, _stn_brg, _stn_range, _stn_height;
90     double _stn_speed, _stn_angle_limit, _stn_limit;
91
92     double _max_speed;
93
94     const SGMaterial* _material;
95
96     bool _MPControl, _patrol, _stn_deg_true;
97
98 //    std::string _parent;
99
100 };
101
102 #endif  // FG_AIGROUNDVEHICLE_HXX