1 /*******************************************************************************
7 ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
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
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
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.
23 Further information about the GNU General Public License can also be found on
24 the world wide web at http://www.gnu.org.
26 FUNCTIONAL DESCRIPTION
27 --------------------------------------------------------------------------------
29 Based on Flightgear code, which is based on LaRCSim. This class wraps all
30 global state variables (such as velocity, position, orientation, etc.).
33 --------------------------------------------------------------------------------
36 ********************************************************************************
38 *******************************************************************************/
43 /*******************************************************************************
45 *******************************************************************************/
48 # include <simgear/compiler.h>
49 # ifdef FG_HAVE_STD_INCLUDES
61 #include "FGInitialCondition.h"
64 /*******************************************************************************
66 *******************************************************************************/
68 /*******************************************************************************
70 *******************************************************************************/
79 bool Reset(string, string, string);
80 void Initialize(float, float, float, float, float, float, float, float, float);
81 void Initialize(FGInitialCondition *FGIC);
82 bool StoreData(string);
84 inline float Getadot(void) { return adot; }
85 inline float Getbdot(void) { return bdot; }
87 inline float GetLocalAltitudeOverRunway(void) { return LocalAltitudeOverRunway; }
88 inline float Geta(void) { return a; }
90 inline float Getsim_time(void) { return sim_time; }
91 inline float Getdt(void) { return dt; }
93 float GetParameter(int val_idx);
94 float GetParameter(string val_string);
95 int GetParameterIndex(string val_string);
97 inline void Setadot(float tt) { adot = tt; }
98 inline void Setbdot(float tt) { bdot = tt; }
100 inline void SetLocalAltitudeOverRunway(float tt) { LocalAltitudeOverRunway = tt; }
101 inline void Seta(float tt) { a = tt; }
103 inline float Setsim_time(float tt) {
107 inline void Setdt(float tt) { dt = tt; }
109 void SetParameter(int, float);
111 inline float IncrTime(void) {
115 void InitMatrices(float phi, float tht, float psi);
116 void CalcMatrices(void);
117 void IntegrateQuat(FGColumnVector vPQR, int rate);
118 FGColumnVector CalcEuler(void);
119 FGMatrix GetTs2b(float alpha, float beta);
120 FGMatrix GetTl2b(void) { return mTl2b; }
121 FGMatrix GetTb2l(void) { return mTb2l; }
125 float adot, bdot; // alpha dot and beta dot
126 float a; // speed of sound
130 float LocalAltitudeOverRunway;
134 FGColumnVector vQtrn;
136 typedef map<string, long> CoeffMap;
140 enum {ePhi=1, eTht, ePsi};
144 /******************************************************************************/