]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPosition.h
Removed FGMatrix.* because it is no longer used by JSBSim.
[flightgear.git] / src / FDM / JSBSim / FGPosition.h
index 354f619449683e774a3afb714325ed0ce674124c..7287ff993b45eb4657830d5bfc2e53922ad85c99 100644 (file)
@@ -1,5 +1,5 @@
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
  Header:       FGPosition.h
  Author:       Jon S. Berndt
  Date started: 1/5/99
@@ -27,72 +27,71 @@ HISTORY
 --------------------------------------------------------------------------------
 01/05/99   JSB   Created
  
-********************************************************************************
-COMMENTS, REFERENCES,  and NOTES
-********************************************************************************
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifndef FGPOSITION_H
 #define FGPOSITION_H
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGModel.h"
-#include "FGMatrix.h"
+#include "FGMatrix33.h"
+#include "FGColumnVector3.h"
+#include "FGColumnVector4.h"
 
-#define ID_POSITION "$Header$"
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
+#define ID_POSITION "$Id$"
 
-/*******************************************************************************
-DEFINITIONS
-*******************************************************************************/
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+COMMENTS, REFERENCES,  and NOTES
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Models the lateral and longitudinal translational EOM.
     @author Jon S. Berndt
     @version $Id$
   */
-/*******************************************************************************
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 class FGPosition : public FGModel {
-  
-  FGColumnVector vUVW;
-  FGColumnVector vVel;
-  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);
-
 public:
+  /** Constructor
+      @param Executive a pointer to the parent executive object */
   FGPosition(FGFDMExec*);
-  ~FGPosition(void);
+  /// Destructor
+  ~FGPosition();
 
-  inline FGColumnVector GetVel(void) { return vVel; }
-  inline FGColumnVector GetVelDot(void) { return vVelDot; }
-  inline FGColumnVector GetUVW(void) { return vUVW; }
+  bool InitModel(void);
+
+  /** Runs the Position model; called by the Executive
+      @see JSBSim.cpp documentation
+      @return false if no error */
+  bool Run(void);
+  
+  inline FGColumnVector3& GetVel(void) { return vVel; }
+  inline FGColumnVector3& GetVelDot(void) { return vVelDot; }
   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 GetGroundTrack(void) { return psigt; }
   inline double Geth(void)  { return h; }
   inline double Gethdot(void) { return RadiusDot; }
   inline double GetLatitude(void) { return Latitude; }
@@ -101,13 +100,15 @@ public:
   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 GetRadius(void) { return Radius; }
+  inline FGColumnVector3& 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; }
+  inline void SetGamma(double tt) { gamma = tt; }
+  inline double GetHOverBCG(void) { return hoverbcg; }
+  inline double GetHOverBMAC(void){ return hoverbmac; }
+  void SetvVel(const FGColumnVector3& v) { vVel = v; }
+  void SetLatitude(double tt) { Latitude = tt; }
   void SetLongitude(double tt) { Longitude = tt; }
   void Seth(double tt);
   void SetRunwayRadius(double tt) { RunwayRadius = tt; }
@@ -117,8 +118,29 @@ public:
       vRunwayNormal << fgx << fgy << fgz;
   }
   
-  bool Run(void);
+private:  
+  FGColumnVector3 vVel;
+  FGColumnVector3 vVelDot;
+  FGColumnVector3 vRunwayNormal;
+  
+  double Radius, h;
+  double LatitudeDot, LongitudeDot, RadiusDot;
+  double lastLatitudeDot, lastLongitudeDot, lastRadiusDot;
+  double Longitude, Latitude;
+  double dt;
+  double RunwayRadius;
+  double DistanceAGL;
+  double SeaLevelRadius;
+  double gamma;
+  double Vt, Vground;
+  double hoverbcg,hoverbmac,b;
+
+  double psigt;
+
+  void GetState(void);
+  void Debug(int from);
 };
 
-/******************************************************************************/
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
+