]> git.mxchange.org Git - flightgear.git/blob - src/AIModel/AIBallistic.hxx
73dce5043914b8fd829788b8226c6c74886ef1bf
[flightgear.git] / src / AIModel / AIBallistic.hxx
1 // FGAIBallistic.hxx - AIBase derived class creates an AI ballistic object
2 //
3 // Written by David Culp, started November 2003.
4 // - davidculp2@comcast.net
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License as
8 // published by the Free Software Foundation; either version 2 of the
9 // License, or (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19
20 #ifndef _FG_AIBALLISTIC_HXX
21 #define _FG_AIBALLISTIC_HXX
22
23 #include "AIManager.hxx"
24 #include "AIBase.hxx"
25
26
27 class FGAIBallistic : public FGAIBase {
28
29 public:
30
31     FGAIBallistic();
32     ~FGAIBallistic();
33
34     void readFromScenario(SGPropertyNode* scFileNode);
35
36     bool init(bool search_in_AI_path=false);
37     virtual void bind();
38     virtual void unbind();
39
40     void update(double dt);
41
42     void setAzimuth( double az );
43     void setElevation( double el );
44     void setRoll( double rl );
45     void setStabilisation( bool val );
46     void setDragArea( double a );
47     void setLife( double seconds );
48     void setBuoyancy( double fpss );
49     void setWind_from_east( double fps );
50     void setWind_from_north( double fps );
51     void setWind( bool val );
52     void setCd( double c );
53     void setMass( double m );
54     void setNoRoll( bool nr );
55     void setRandom( bool r );
56     void setName(const string&);
57     void setImpact(bool i);
58     void setImpactReportNode(const string&);
59
60     double _getTime() const;
61
62     virtual const char* getTypeString(void) const { return "ballistic"; }
63     static const double slugs_to_kgs; //conversion factor
64
65 private:
66
67     double _azimuth;         // degrees true
68     double _elevation;       // degrees
69     double _rotation;        // degrees
70     bool   _aero_stabilised; // if true, object will align with trajectory
71     double _drag_area;       // equivalent drag area in ft2
72     double _life_timer;      // seconds
73     double _gravity;         // fps2
74     double _buoyancy;        // fps2
75     double _wind_from_east;  // fps
76     double _wind_from_north; // fps
77     bool   _wind;            // if true, local wind will be applied to object
78     double _Cd;              // drag coefficient
79     double _mass;            // slugs
80     bool   _random;          // modifier for Cd
81     double _ht_agl_ft;       // height above ground level
82     double _load_resistance; // ground load resistanc N/m^2
83     bool   _solid;           // if true ground is solid for FDMs
84     bool   _report_impact;   // if true an impact point on the terrain is calculated
85     bool   _impact_reported; // if true impact data have been set
86     SGPropertyNode_ptr _impact_report_node;
87
88     string _mat_name;
89     string _name;
90
91     void Run(double dt);
92     void handle_impact();
93
94     // FGAIBase* _ai;
95 };
96
97 #endif  // _FG_AIBALLISTIC_HXX