]> git.mxchange.org Git - flightgear.git/blobdiff - FDM/flight.hxx
Working on being able to extrapolate a new position and orientation
[flightgear.git] / FDM / flight.hxx
index fdd514bd18a96c254a7cc28d4c3a81ce5500a801..6a41775c848afba3f539ce8bd92cd4c10623cd41 100644 (file)
 #define _FLIGHT_HXX
 
 
+#ifndef __cplusplus                                                          
+# error This library requires C++
+#endif                                   
+
+
 /* Required get_()
 
    `FGState::get_Longitude ()'
@@ -52,6 +57,7 @@
 
    `FGState::get_Gamma_vert_rad ()'
    `FGState::get_Climb_Rate ()'
+   `FGState::get_Alpha ()'
    `FGState::get_Beta ()'
 
    `FGState::get_Runway_altitude ()'
    `FGState::get_Sea_level_radius ()'
    `FGState::get_Earth_position_angle ()'
 
+   `FGState::get_Latitude_dot()'
+   `FGState::get_Longitude_dot()'
+   `FGState::get_Radius_dot()'
+
    `FGState::get_Dx_cg ()'
    `FGState::get_Dy_cg ()'
    `FGState::get_Dz_cg ()'
 
  */
 
-#include <Flight/Slew/slew.hxx>
-
-
-#ifndef __cplusplus                                                          
-# error This library requires C++
-#endif                                   
 
+#include <Time/timestamp.hxx>
 
 typedef double FG_VECTOR_3[3];
 
@@ -511,14 +516,14 @@ public:
 
     FG_VECTOR_3    geocentric_rates_v;     // Geocentric linear velocities
     // inline double * get_Geocentric_rates_v() { return geocentric_rates_v; }
-    // inline double get_Latitude_dot() const { return geocentric_rates_v[0]; }
-    // inline double get_Longitude_dot() const { return geocentric_rates_v[1]; }
-    // inline double get_Radius_dot() const { return geocentric_rates_v[2]; }
-    /* inline void set_Geocentric_Rates( double lat, double lon, double rad ) {
+    inline double get_Latitude_dot() const { return geocentric_rates_v[0]; }
+    inline double get_Longitude_dot() const { return geocentric_rates_v[1]; }
+    inline double get_Radius_dot() const { return geocentric_rates_v[2]; }
+    inline void set_Geocentric_Rates( double lat, double lon, double rad ) {
        geocentric_rates_v[0] = lat;
        geocentric_rates_v[1] = lon;
        geocentric_rates_v[2] = rad;
-    } */
+    }
     
     /*=============================== Positions ===============================*/
 
@@ -538,6 +543,7 @@ public:
     inline void set_Radius_to_vehicle(double radius) {
        geocentric_position_v[2] = radius;
     }
+
     inline void set_Geocentric_Position( double lat, double lon, double rad ) {
        geocentric_position_v[0] = lat;
        geocentric_position_v[1] = lon;
@@ -621,8 +627,8 @@ public:
     // inline void set_Centrifugal_relief(double cr) { centrifugal_relief = cr; }
 
     double    alpha, beta, alpha_dot, beta_dot;   // in radians  
-    // inline double get_Alpha() const { return alpha; }
-    // inline void set_Alpha( double a ) { alpha = a; }
+    inline double get_Alpha() const { return alpha; }
+    inline void set_Alpha( double a ) { alpha = a; }
     inline double get_Beta() const { return beta; }
     inline void set_Beta( double b ) { beta = b; }
     // inline double get_Alpha_dot() const { return alpha_dot; }
@@ -769,6 +775,15 @@ public:
     double        climb_rate;           // in feet per second
     inline double get_Climb_Rate() const { return climb_rate; }
     inline void set_Climb_Rate(double rate) { climb_rate = rate; }
+
+    FGTimeStamp valid_stamp;       // time this record is valid
+    FGTimeStamp next_stamp;       // time this record is valid
+    inline FGTimeStamp get_time_stamp() const { return valid_stamp; }
+    inline void stamp_time() { valid_stamp = next_stamp; next_stamp.stamp(); }
+
+    // Extrapolate FDM based on time_offset (in usec)
+    void extrapolate( int time_offset );
+
 };
 
 
@@ -781,16 +796,30 @@ extern FGState cur_fdm_state;
 int fgFlightModelInit(int model, FGState& f, double dt);
 
 // Run multiloop iterations of the flight model
-int fgFlightModelUpdate(int model, FGState& f, int multiloop);
+int fgFlightModelUpdate(int model, FGState& f, int multiloop, int jitter);
 
 // Set the altitude (force)
-void fgFlightModelSetAltitude(int model, FGState& f, double alt_meters);
+void fgFlightModelSetAltitude(int model, double alt_meters);
 
 
 #endif // _FLIGHT_HXX
 
 
 // $Log$
+// Revision 1.11  1999/01/19 17:52:07  curt
+// Working on being able to extrapolate a new position and orientation
+// based on a position, orientation, and time offset.
+//
+// Revision 1.10  1999/01/09 13:37:33  curt
+// Convert fgTIMESTAMP to FGTimeStamp which holds usec instead of ms.
+//
+// Revision 1.9  1999/01/08 19:27:38  curt
+// Fixed AOA reading on HUD.
+// Continued work on time jitter compensation.
+//
+// Revision 1.8  1999/01/08 03:23:52  curt
+// Beginning work on compensating for sim time vs. real world time "jitter".
+//
 // Revision 1.7  1998/12/18 23:37:09  curt
 // Collapsed out the FGState variables not currently needed.  They are just
 // commented out and can be readded easily at any time.  The point of this