]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGLGear.h
Oct. 9, 2000 - synced with latest JSBsim code.
[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   FGColumnVector GetBodyLocation(void) { return vWhlBodyVec; }
88
89   inline string GetName(void)      {return name;          }
90   inline bool   GetWOW(void)       {return WOW;           }
91   inline float  GetCompLen(void)   {return compressLength;}
92   inline float  GetCompVel(void)   {return compressSpeed; }
93   inline float  GetCompForce(void) {return Force()(3);    }
94   
95   inline void SetBrake(double bp) {brakePct = bp;}
96   
97   inline void SetReport(bool bb) { ReportEnable=bb; }
98   inline bool GetReport(void)    { return ReportEnable; }
99   
100
101 private:
102   enum {eX=1, eY, eZ};
103   FGColumnVector vXYZ;
104   FGColumnVector vMoment;
105   FGColumnVector vWhlBodyVec;
106   float kSpring;
107   float bDamp;
108   float compressLength;
109   float compressSpeed;
110   float staticFCoeff, dynamicFCoeff;
111   float brakePct;
112   float maxCompLen;
113   double SinkRate;
114   double GroundSpeed;
115   double DistanceTraveled;
116   double MaximumStrutForce;
117   double MaximumStrutTravel;
118   bool WOW;
119   bool FirstContact;
120   bool Reported;
121   bool ReportEnable;
122   string name;
123   string BrakeType;
124   string SteerType;
125   string GroupMember;
126   float  maxSteerAngle;
127
128   FGFDMExec*     Exec;
129   FGState*       State;
130   FGAircraft*    Aircraft;
131   FGPosition*    Position;
132   FGRotation*    Rotation;
133
134   void Report(void);
135 };
136
137 #include "FGAircraft.h"
138 #include "FGPosition.h"
139 #include "FGRotation.h"
140
141 /******************************************************************************/
142 #endif