]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPosition.h
Encapsulate the interpolstion version of FGEnvironment and fix some bugs
[flightgear.git] / src / FDM / JSBSim / FGPosition.h
index 095018a4fe6ed55a69ba2dab0b8b0960c64a7413..bac37730af727003cb207cf0e80eff64d6a3ba6c 100644 (file)
@@ -53,12 +53,10 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-DOCUMENTATION
+CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Models the lateral and longitudinal translational EOM.
@@ -74,7 +72,8 @@ class FGPosition : public FGModel {
 public:
   /** Constructor
       @param Executive a pointer to the parent executive object */
-  FGPosition(FGFDMExec*);
+  FGPosition(FGFDMExec* Executive);
+
   /// Destructor
   ~FGPosition();
 
@@ -87,25 +86,29 @@ public:
   
   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; }
-  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 double GetRadius(void) { return Radius; }
+  inline double GetVn(void)  const { return vVel(eX); }
+  inline double GetVe(void)  const { return vVel(eY); }
+  inline double GetVd(void)  const { return vVel(eZ); }
+  inline double GetVground(void) const { return Vground; }
+  inline double GetGroundTrack(void) const { return psigt; }
+  inline double Geth(void)  const { return h; }
+  inline double GethVRP(void)  const { return hVRP; }
+  inline double Gethdot(void) const { return RadiusDot; }
+  inline double GetLatitude(void) const { return Latitude; }
+  inline double GetLatitudeVRP(void) const { return LatitudeVRP; }
+  inline double GetLatitudeDot(void) const { return LatitudeDot; }
+  inline double GetLongitude(void) const { return Longitude; }
+  inline double GetLongitudeVRP(void) const { return LongitudeVRP; }
+  inline double GetLongitudeDot(void) const { return LongitudeDot; }
+  inline double GetRunwayRadius(void) const { return RunwayRadius; }
+  inline double GetDistanceAGL(void)  const { return DistanceAGL; }
+  inline double GetRadius(void) const { return Radius; }
   inline FGColumnVector3& GetRunwayNormal(void) { return vRunwayNormal; }
   
-  inline double GetGamma(void) { return gamma; }
+  inline double GetGamma(void) const { return gamma; }
   inline void SetGamma(double tt) { gamma = tt; }
-  inline double GetHOverB(void) { return hoverb; }
+  inline double GetHOverBCG(void) const { return hoverbcg; }
+  inline double GetHOverBMAC(void) const { return hoverbmac; }
   void SetvVel(const FGColumnVector3& v) { vVel = v; }
   void SetLatitude(double tt) { Latitude = tt; }
   void SetLongitude(double tt) { Longitude = tt; }
@@ -116,31 +119,38 @@ public:
   inline void SetRunwayNormal(double fgx, double fgy, double fgz ) {
       vRunwayNormal << fgx << fgy << fgz;
   }
+  void SetVRP(FGColumnVector3& vrp) {vVRP = vrp;}
+  
+  void bind(void);
+  void unbind(void);
   
 private:  
   FGColumnVector3 vVel;
   FGColumnVector3 vVelDot;
   FGColumnVector3 vRunwayNormal;
+  FGColumnVector3 vVRP;
+  FGColumnVector3 vVRPoffset;
+  FGColumnVector3 vMac;
   
-  double Vee, invMass, invRadius;
-  double Radius, h;
+  double Radius, h, hVRP;
   double LatitudeDot, LongitudeDot, RadiusDot;
-  double lastLatitudeDot, lastLongitudeDot, lastRadiusDot;
+  double LatitudeDot_prev[4], LongitudeDot_prev[4], RadiusDot_prev[4];
   double Longitude, Latitude;
+  double LongitudeVRP, LatitudeVRP;
   double dt;
   double RunwayRadius;
   double DistanceAGL;
   double SeaLevelRadius;
   double gamma;
   double Vt, Vground;
-  double hoverb,b;
+  double hoverbcg,hoverbmac,b;
 
   double psigt;
 
   void GetState(void);
-  void Debug(void);
+  void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif