]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBsim/FGPosition.h
source tree reorganization prior to flightgear 0.7
[flightgear.git] / src / FDM / JSBsim / FGPosition.h
1 /*******************************************************************************
2
3  Header:       FGPosition.h
4  Author:       Jon S. Berndt
5  Date started: 1/5/99
6
7  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  details.
18
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 HISTORY
27 --------------------------------------------------------------------------------
28 01/05/99   JSB   Created
29
30 ********************************************************************************
31 COMMENTS, REFERENCES,  and NOTES
32 ********************************************************************************
33
34 ********************************************************************************
35 SENTRY
36 *******************************************************************************/
37
38 #ifndef FGPOSITION_H
39 #define FGPOSITION_H
40
41 /*******************************************************************************
42 INCLUDES
43 *******************************************************************************/
44 #include "FGModel.h"
45
46 using namespace std;
47
48 /*******************************************************************************
49 CLASS DECLARATION
50 *******************************************************************************/
51
52 class FGPosition : public FGModel
53 {
54 public:
55   FGPosition(FGFDMExec*);
56   ~FGPosition(void);
57
58   inline float GetFn(void) {return Fn;}
59   inline float GetFe(void) {return Fe;}
60   inline float GetFd(void) {return Fd;}
61
62   inline float GetVn(void) {return Vn;}
63   inline float GetVe(void) {return Ve;}
64   inline float GetVd(void) {return Vd;}
65
66   inline float GetT(int r, int c) {return T[r][c];}
67   inline void SetT(float t1, float t2, float t3, float t4, float t5, float t6,
68                                                    float t7, float t8, float t9)
69                                          {T[1][1]=t1; T[1][2]=t2 ;T[1][3]=t3;
70                                           T[2][1]=t4; T[2][2]=t5 ;T[2][3]=t6;
71                                           T[3][1]=t7; T[3][2]=t8 ;T[3][3]=t9;}
72
73   bool Run(void);
74
75 protected:
76
77 private:
78   float T[4][4];
79   float Q0, Q1, Q2, Q3;
80   float Fn, Fe, Fd;
81   float Fx, Fy, Fz;
82   float U, V, W;
83   float Vn, Ve, Vd, Vee;
84   float invMass, invRadius;
85   float Radius;
86   float AccelN, AccelE, AccelD;
87   float lastAccelN, lastAccelE, lastAccelD;
88   float LatitudeDot, LongitudeDot, RadiusDot;
89   float lastLatitudeDot, lastLongitudeDot, lastRadiusDot;
90   float Longitude, Latitude;
91   float dt;
92
93   void GetState(void);
94   void PutState(void);
95 };
96
97 /******************************************************************************/
98 #endif