]> git.mxchange.org Git - flightgear.git/blob - External/external.hxx
Convert fgTIMESTAMP to FGTimeStamp which holds usec instead of ms.
[flightgear.git] / External / external.hxx
1 // external.hxx -- the "external" flight model (driven from other
2 //                 external input)
3 //
4 // Written by Curtis Olson, started December 1998.
5 //
6 // Copyright (C) 1998  Curtis L. Olson  - curt@flightgear.org
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 //
22 // $Id$
23 // (Log is kept at end of this file)
24
25
26 #ifndef _EXTERNAL_HXX
27 #define _EXTERNAL_HXX
28
29
30 #ifndef __cplusplus                                                          
31 # error This library requires C++
32 #endif                                   
33
34
35 #include <Time/fg_time.hxx>
36 #include <Time/timestamp.hxx>
37
38
39 class fgFDM_EXTERNAL {
40
41 public:
42
43     // Time Stamp
44
45     // The time at which these values are correct (for extrapolating
46     // later frames between position updates)
47     FGTimeStamp t;
48
49     // Positions
50
51     // placement in geodetic coordinates
52     double Latitude;
53     double Longitude;
54     double Altitude;
55
56     // orientation in euler angles relative to local frame (or ground
57     // position)
58     double Phi;       // roll
59     double Theta;     // pitch
60     double Psi;       // heading
61
62     // Velocities
63
64     // velocity relative to the local aircraft's coordinate system
65     double V_north;
66     double V_east;
67     double V_down;
68
69     // rotational rates relative to the coordinate system the body lives in
70     double P_body;
71     double Q_body;
72     double R_body;
73
74     // Accelerations
75     
76     // acceleration relative to the local aircraft's coordinate system
77     double V_dot_north;
78     double V_dot_east;
79     double V_dot_down;
80
81     // rotational acceleration relative to the coordinate system the
82     // body lives in
83     double P_dot_body;
84     double Q_dot_body;
85     double R_dot_body;
86 };
87
88
89 // reset flight params to a specific position 
90 void fgExternalInit( FGState& f, double dt );
91
92 // update position based on inputs, positions, velocities, etc.
93 void fgExternalUpdate( FGState& f, int multiloop );
94
95
96 #endif // _EXTERNAL_HXX
97
98
99 // $Log$
100 // Revision 1.4  1999/01/09 13:37:37  curt
101 // Convert fgTIMESTAMP to FGTimeStamp which holds usec instead of ms.
102 //
103 // Revision 1.3  1998/12/05 15:54:14  curt
104 // Renamed class fgFLIGHT to class FGState as per request by JSB.
105 //
106 // Revision 1.2  1998/12/05 14:18:47  curt
107 // added an fgTIMESTAMP to define when this record is valid.
108 //
109 // Revision 1.1  1998/12/04 01:28:49  curt
110 // Initial revision.
111 //