]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPosition.h
Check return value of FDM::init().
[flightgear.git] / src / FDM / JSBSim / FGPosition.h
index 0bff7bbfb4249b9ce06821ec42b087c351318837..354f619449683e774a3afb714325ed0ce674124c 100644 (file)
@@ -1,36 +1,36 @@
 /*******************************************************************************
-
  Header:       FGPosition.h
  Author:       Jon S. Berndt
  Date started: 1/5/99
-
  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
-
  This program is free software; you can redistribute it and/or modify it under
  the terms of the GNU General Public License as published by the Free Software
  Foundation; either version 2 of the License, or (at your option) any later
  version.
-
  This program is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  details.
-
  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  Place - Suite 330, Boston, MA  02111-1307, USA.
-
  Further information about the GNU General Public License can also be found on
  the world wide web at http://www.gnu.org.
-
 HISTORY
 --------------------------------------------------------------------------------
 01/05/99   JSB   Created
-
 ********************************************************************************
 COMMENTS, REFERENCES,  and NOTES
 ********************************************************************************
-
 ********************************************************************************
 SENTRY
 *******************************************************************************/
@@ -45,37 +45,78 @@ INCLUDES
 #include "FGModel.h"
 #include "FGMatrix.h"
 
-using namespace std;
+#define ID_POSITION "$Header$"
+
 
+/*******************************************************************************
+DEFINITIONS
+*******************************************************************************/
+
+/** Models the lateral and longitudinal translational EOM.
+    @author Jon S. Berndt
+    @version $Id$
+  */
 /*******************************************************************************
 CLASS DECLARATION
 *******************************************************************************/
 
-class FGPosition : public FGModel
-{
+class FGPosition : public FGModel {
+  
   FGColumnVector vUVW;
   FGColumnVector vVel;
-
-  float Vee, invMass, invRadius;
-  double Radius;
-  float LatitudeDot, LongitudeDot, RadiusDot;
-  float lastLatitudeDot, lastLongitudeDot, lastRadiusDot;
-  float Longitude, Latitude;
+  FGColumnVector vVelDot;
+  FGColumnVector vRunwayNormal;
+  
+  double Vee, invMass, invRadius;
+  double Radius, h;
+  double LatitudeDot, LongitudeDot, RadiusDot;
+  double lastLatitudeDot, lastLongitudeDot, lastRadiusDot;
+  double Longitude, Latitude;
   float dt;
+  double RunwayRadius;
+  double DistanceAGL;
+  double SeaLevelRadius;
+  double gamma;
+  double Vt, Vground;
+  double hoverb,b;
 
   void GetState(void);
-  void PutState(void);
 
 public:
   FGPosition(FGFDMExec*);
   ~FGPosition(void);
 
-  inline FGColumnVector GetVel(void) {return vVel;}
-  inline FGColumnVector GetUVW(void) {return vUVW;}
-  inline FGColumnVector GetVn(void)  {return vVel(1);}
-  inline FGColumnVector GetVe(void)  {return vVel(2);}
-  inline FGColumnVector GetVd(void)  {return vVel(3);}
-
+  inline FGColumnVector GetVel(void) { return vVel; }
+  inline FGColumnVector GetVelDot(void) { return vVelDot; }
+  inline FGColumnVector GetUVW(void) { return vUVW; }
+  inline double GetVn(void)  { return vVel(eX); }
+  inline double GetVe(void)  { return vVel(eY); }
+  inline double GetVd(void)  { return vVel(eZ); }
+  inline double GetVground(void) { return Vground; }
+  inline double Geth(void)  { return h; }
+  inline double Gethdot(void) { return RadiusDot; }
+  inline double GetLatitude(void) { return Latitude; }
+  inline double GetLatitudeDot(void) { return LatitudeDot; }
+  inline double GetLongitude(void) { return Longitude; }
+  inline double GetLongitudeDot(void) { return LongitudeDot; }
+  inline double GetRunwayRadius(void) { return RunwayRadius; }
+  inline double GetDistanceAGL(void)  { return DistanceAGL; }
+  inline FGColumnVector GetRunwayNormal(void) { return vRunwayNormal; }
+  
+  inline double GetGamma(void) { return gamma; }
+  inline void SetGamma(float tt) { gamma = tt; }
+  inline double GetHOverB(void) { return hoverb; }
+  void SetvVel(const FGColumnVector& v) { vVel = v; }
+  void SetLatitude(float tt) { Latitude = tt; }
+  void SetLongitude(double tt) { Longitude = tt; }
+  void Seth(double tt);
+  void SetRunwayRadius(double tt) { RunwayRadius = tt; }
+  void SetSeaLevelRadius(double tt) { SeaLevelRadius = tt;}
+  void SetDistanceAGL(double tt);
+  inline void SetRunwayNormal(double fgx, double fgy, double fgz ) {
+      vRunwayNormal << fgx << fgy << fgz;
+  }
+  
   bool Run(void);
 };