]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGLGear.h
Fixes to jsbsim.
[flightgear.git] / src / FDM / JSBSim / FGLGear.h
1 /*******************************************************************************
2
3  Header:       FGLGear.h
4  Author:       Jon S. Berndt
5  Date started: 11/18/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 11/18/99   JSB   Created
29
30 ********************************************************************************
31 SENTRY
32 *******************************************************************************/
33
34 #ifndef FGLGEAR_H
35 #define FGLGEAR_H
36
37 /*******************************************************************************
38 COMMENTS, REFERENCES,  and NOTES
39 ********************************************************************************
40
41 [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
42            Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420  Naval Postgraduate
43            School, January 1994
44 [2] D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
45            JSC 12960, July 1977
46 [3] Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
47            NASA-Ames", NASA CR-2497, January 1975
48 [4] Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
49            Wiley & Sons, 1979 ISBN 0-471-03032-5
50 [5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
51            1982 ISBN 0-471-08936-2
52
53 ********************************************************************************
54 INCLUDES
55 *******************************************************************************/
56
57 #ifdef FGFS
58 #  include <simgear/compiler.h>
59 #endif
60
61 #include <string>
62 #include "FGConfigFile.h"
63 #include "FGMatrix.h"
64 #include "FGFDMExec.h"
65 #include "FGState.h"
66
67 /*******************************************************************************
68 DEFINITIONS
69 *******************************************************************************/
70
71 /*******************************************************************************
72 CLASS DECLARATION
73 *******************************************************************************/
74
75 class FGAircraft;
76 class FGPosition;
77 class FGRotation;
78
79 class FGLGear
80 {
81 public:
82   FGLGear(FGConfigFile*, FGFDMExec*);
83   ~FGLGear(void);
84
85   FGColumnVector Force(void);
86   FGColumnVector Moment(void) {return vMoment;}
87
88   inline string GetName(void)      {return name;          }
89   inline bool   GetWOW(void)       {return WOW;           }
90   inline float  GetCompLen(void)   {return compressLength;}
91   inline float  GetCompVel(void)   {return compressSpeed; }
92   inline float  GetCompForce(void) {return Force()(3);    }
93
94 private:
95   enum {eX=1, eY, eZ};
96   FGColumnVector vXYZ;
97   FGColumnVector vMoment;
98   float kSpring, bDamp, compressLength, compressSpeed;
99   float statFCoeff, rollFCoeff, skidFCoeff;
100   float frictionForce, compForce;
101   float brakePct, brakeForce, brakeCoeff;
102   double SinkRate;
103   double GroundSpeed;
104   double DistanceTraveled;
105   double MaximumStrutForce;
106   double MaximumStrutTravel;
107   bool WOW;
108   bool FirstContact;
109   bool Reported;
110   string name;
111
112   FGFDMExec*     Exec;
113   FGState*       State;
114   FGAircraft*    Aircraft;
115   FGPosition*    Position;
116   FGRotation*    Rotation;
117
118   void Report(void);
119 };
120
121 #include "FGAircraft.h"
122 #include "FGPosition.h"
123 #include "FGRotation.h"
124
125 /******************************************************************************/
126 #endif