]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGLGear.cpp
Updates from the Jon and Tony show.
[flightgear.git] / src / FDM / JSBSim / FGLGear.cpp
1 /*******************************************************************************
2
3  Module:       FGLGear.cpp
4  Author:       Jon S. Berndt
5  Date started: 11/18/99
6  Purpose:      Encapsulates the landing gear elements
7  Called by:    FGAircraft
8
9  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
10
11  This program is free software; you can redistribute it and/or modify it under
12  the terms of the GNU General Public License as published by the Free Software
13  Foundation; either version 2 of the License, or (at your option) any later
14  version.
15
16  This program is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
19  details.
20
21  You should have received a copy of the GNU General Public License along with
22  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23  Place - Suite 330, Boston, MA  02111-1307, USA.
24
25  Further information about the GNU General Public License can also be found on
26  the world wide web at http://www.gnu.org.
27
28 FUNCTIONAL DESCRIPTION
29 --------------------------------------------------------------------------------
30
31 HISTORY
32 --------------------------------------------------------------------------------
33 11/18/99   JSB   Created
34
35 ********************************************************************************
36 INCLUDES
37 *******************************************************************************/
38
39 #include "FGLGear.h"
40
41 /*******************************************************************************
42 ************************************ CODE **************************************
43 *******************************************************************************/
44
45
46 FGLGear::FGLGear(FGConfigFile* AC_cfg, FGFDMExec* fdmex) : vXYZ(3), Exec(fdmex)
47 {
48   string tmp;
49   *AC_cfg >> tmp >> name >> vXYZ(1) >> vXYZ(2) >> vXYZ(3) >> kSpring >> bDamp
50                                                     >> statFCoeff >> brakeCoeff;
51   State = Exec->GetState();
52   Aircraft = Exec->GetAircraft();
53   Position = Exec->GetPosition();                                                  
54 }
55
56
57 /******************************************************************************/
58
59 FGLGear::~FGLGear(void)
60 {
61 }
62
63 /******************************************************************************/
64
65 FGColumnVector FGLGear::Force(void)
66 {
67   static FGColumnVector vForce(3);
68   static FGColumnVector vLocalGear(3);
69
70   vLocalGear = State->GetTb2l() * (vXYZ - Aircraft->GetXYZcg());
71   vLocalGear(3) = -vLocalGear(3);
72
73   return vForce;
74 }
75
76 /******************************************************************************/
77