]> git.mxchange.org Git - flightgear.git/blob - src/AIModel/AIBallistic.hxx
Mathias Froehlich:
[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., 675 Mass Ave, Cambridge, MA 02139, 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();
37     virtual void bind();
38     virtual void unbind();
39     void update(double dt);
40
41     void setAzimuth( double az );
42     void setElevation( double el );
43     void setRoll( double rl );
44     void setStabilisation( bool val );
45     void setDragArea( double a );
46     void setLife( double seconds );
47     void setBuoyancy( double fpss );
48     void setWind_from_east( double fps );
49     void setWind_from_north( double fps );
50     void setWind( bool val );
51     void setCd( double c );
52     void setMass( double m );
53
54     double _getTime() const;
55
56     virtual const char* getTypeString(void) const { return "ballistic"; }
57
58 private:
59
60     double azimuth;         // degrees true
61     double elevation;       // degrees
62     double rotation;        // degrees
63     double hs;              // horizontal speed (fps)
64     bool aero_stabilised;   // if true, object will align wit trajectory
65     double drag_area;       // equivalent drag area in ft2
66     double life_timer;      // seconds
67     double gravity;         // fps2
68     double buoyancy;        // fps2
69     double wind_from_east;  // fps
70     double wind_from_north; // fps
71     bool wind;              // if true, local wind will be applied to object
72     double Cd;              // drag coefficient
73     double mass;            // slugs
74
75     void Run(double dt);
76 };
77
78 #endif  // _FG_AIBALLISTIC_HXX
79