]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/flight.hxx
JSBSim updates.
[flightgear.git] / src / FDM / flight.hxx
index 2e3d793942f0aeb93465bd96399ca6418a43628c..efd04db45ea47bae6dd00feae40918db2183ca86 100644 (file)
@@ -81,7 +81,7 @@
  */
 
 
-#include <Include/compiler.h>
+#include <simgear/compiler.h>
 
 #include <math.h>
 
@@ -105,10 +105,14 @@ class FGInterface {
 
 public:
 
+    virtual int init( double dt );
+    virtual int update( int multi_loop );
+    virtual ~FGInterface();
+
     // Define the various supported flight models (many not yet implemented)
     enum {
-       // Slew (in MS terminology)
-       FG_SLEW = 0,
+       // Magic Carpet mode
+       FG_MAGICCARPET = 0,
        
        // The NASA LaRCsim (Navion) flight model
        FG_LARCSIM = 1,
@@ -116,13 +120,15 @@ public:
        // Jon S. Berndt's new FDM written from the ground up in C++
        FG_JSBSIM = 2,
 
+       // Christian's hot air balloon simulation
+       FG_BALLOONSIM = 3,
+
        // The following aren't implemented but are here to spark
        // thoughts and discussions, and maybe even action.
-       FG_ACM = 3,
-       FG_SUPER_SONIC = 4,
-       FG_HELICOPTER = 5,
-       FG_AUTOGYRO = 6,
-       FG_BALLOON = 7,
+       FG_ACM = 4,
+       FG_SUPER_SONIC = 5,
+       FG_HELICOPTER = 6,
+       FG_AUTOGYRO = 7,
        FG_PARACHUTE = 8,
 
        // Driven externally via a serial port, net, file, etc.
@@ -292,14 +298,14 @@ public:
 
     FG_VECTOR_3    v_dot_local_v;
     // inline double * get_V_dot_local_v() { return v_dot_local_v; }
-    // inline double get_V_dot_north() const { return v_dot_local_v[0]; }
-    // inline double get_V_dot_east() const { return v_dot_local_v[1]; }
-    // inline double get_V_dot_down() const { return v_dot_local_v[2]; }
-    /* inline void set_Accels_Local( double north, double east, double down ) {
+    inline double get_V_dot_north() const { return v_dot_local_v[0]; }
+    inline double get_V_dot_east() const { return v_dot_local_v[1]; }
+    inline double get_V_dot_down() const { return v_dot_local_v[2]; }
+    inline void set_Accels_Local( double north, double east, double down ) {
        v_dot_local_v[0] = north;
        v_dot_local_v[1] = east;
        v_dot_local_v[2] = down;
-    } */
+    }
 
     FG_VECTOR_3    v_dot_body_v;
     // inline double * get_V_dot_body_v() { return v_dot_body_v; }
@@ -335,26 +341,30 @@ public:
     }
 
     FG_VECTOR_3    n_cg_body_v;
-    // inline double * get_N_cg_body_v() { return n_cg_body_v; }
-    // inline double get_N_X_cg() const { return n_cg_body_v[0]; }
-    // inline double get_N_Y_cg() const { return n_cg_body_v[1]; }
-    // inline double get_N_Z_cg() const { return n_cg_body_v[2]; }
-    /* inline void set_Accels_CG_Body_N( double x, double y, double z ) {
+     inline double * get_N_cg_body_v() { return n_cg_body_v; }
+     inline double get_N_X_cg() const { return n_cg_body_v[0]; }
+     inline double get_N_Y_cg() const { return n_cg_body_v[1]; }
+     inline double get_N_Z_cg() const { return n_cg_body_v[2]; }
+     inline void set_Accels_CG_Body_N( double x, double y, double z ) {
        n_cg_body_v[0] = x;
        n_cg_body_v[1] = y;
        n_cg_body_v[2] = z;
-    } */
+    } 
 
     FG_VECTOR_3    n_pilot_body_v;
     // inline double * get_N_pilot_body_v() { return n_pilot_body_v; }
-    // inline double get_N_X_pilot() const { return n_pilot_body_v[0]; }
-    // inline double get_N_Y_pilot() const { return n_pilot_body_v[1]; }
-    // inline double get_N_Z_pilot() const { return n_pilot_body_v[2]; }
-    /* inline void set_Accels_Pilot_Body_N( double x, double y, double z ) {
+    inline double get_N_X_pilot() const { return n_pilot_body_v[0]; }
+    inline double get_N_Y_pilot() const { return n_pilot_body_v[1]; }
+    inline double get_N_Z_pilot() const { return n_pilot_body_v[2]; }
+    inline void set_Accels_Pilot_Body_N( double x, double y, double z ) {
        n_pilot_body_v[0] = x;
        n_pilot_body_v[1] = y;
        n_pilot_body_v[2] = z;
-    } */
+    } 
+    
+    double nlf;  //Normal Load Factor
+    double get_Nlf(void) { return nlf; }  
+    void set_Nlf(double n) { nlf=n;  }
 
     FG_VECTOR_3    omega_dot_body_v;
     // inline double * get_Omega_dot_body_v() { return omega_dot_body_v; }
@@ -400,16 +410,16 @@ public:
 
     FG_VECTOR_3    v_local_airmass_v;   // velocity of airmass (steady winds)
     // inline double * get_V_local_airmass_v() { return v_local_airmass_v; }
-    // inline double get_V_north_airmass() const { return v_local_airmass_v[0]; }
-    // inline double get_V_east_airmass() const { return v_local_airmass_v[1]; }
-    // inline double get_V_down_airmass() const { return v_local_airmass_v[2]; }
-    /* inline void set_Velocities_Local_Airmass( double north, double east, 
+    inline double get_V_north_airmass() const { return v_local_airmass_v[0]; }
+    inline double get_V_east_airmass() const { return v_local_airmass_v[1]; }
+    inline double get_V_down_airmass() const { return v_local_airmass_v[2]; }
+    inline void set_Velocities_Local_Airmass( double north, double east, 
                                              double down)
     {
        v_local_airmass_v[0] = north;
        v_local_airmass_v[1] = east;
        v_local_airmass_v[2] = down;
-    } */
+    } 
 
     FG_VECTOR_3    v_local_rel_airmass_v;  // velocity of veh. relative to
     // airmass
@@ -473,8 +483,8 @@ public:
     // inline double get_V_inertial() const { return v_inertial; }
     // inline void set_V_inertial(double v) { v_inertial = v; }
 
-    // inline double get_V_ground_speed() const { return v_ground_speed; }
-    // inline void set_V_ground_speed( double v) { v_ground_speed = v; }
+    inline double get_V_ground_speed() const { return v_ground_speed; }
+    inline void set_V_ground_speed( double v) { v_ground_speed = v; }
 
     // inline double get_V_equiv() const { return v_equiv; }
     // inline void set_V_equiv( double v ) { v_equiv = v; }
@@ -482,11 +492,11 @@ public:
     inline double get_V_equiv_kts() const { return v_equiv_kts; }
     inline void set_V_equiv_kts( double kts ) { v_equiv_kts = kts; }
 
-    // inline double get_V_calibrated() const { return v_calibrated; }
-    // inline void set_V_calibrated( double v ) { v_calibrated = v; }
+    //inline double get_V_calibrated() const { return v_calibrated; }
+    //inline void set_V_calibrated( double v ) { v_calibrated = v; }
 
-    // inline double get_V_calibrated_kts() const { return v_calibrated_kts; }
-    // inline void set_V_calibrated_kts( double kts ) { v_calibrated_kts = kts; }
+    inline double get_V_calibrated_kts() const { return v_calibrated_kts; }
+    inline void set_V_calibrated_kts( double kts ) { v_calibrated_kts = kts; }
 
     FG_VECTOR_3    omega_body_v;   // Angular B rates     
     // inline double * get_Omega_body_v() { return omega_body_v; }
@@ -523,14 +533,14 @@ public:
 
     FG_VECTOR_3    euler_rates_v;
     // inline double * get_Euler_rates_v() { return euler_rates_v; }
-    // inline double get_Phi_dot() const { return euler_rates_v[0]; }
-    // inline double get_Theta_dot() const { return euler_rates_v[1]; }
-    // inline double get_Psi_dot() const { return euler_rates_v[2]; }
-    /* inline void set_Euler_Rates( double phi, double theta, double psi ) {
+    inline double get_Phi_dot() const { return euler_rates_v[0]; }
+    inline double get_Theta_dot() const { return euler_rates_v[1]; }
+    inline double get_Psi_dot() const { return euler_rates_v[2]; }
+    inline void set_Euler_Rates( double phi, double theta, double psi ) {
        euler_rates_v[0] = phi;
        euler_rates_v[1] = theta;
        euler_rates_v[2] = psi;
-    } */
+    } 
 
     FG_VECTOR_3    geocentric_rates_v;     // Geocentric linear velocities
     // inline double * get_Geocentric_rates_v() { return geocentric_rates_v; }
@@ -665,12 +675,12 @@ public:
     // inline void set_Sin_beta( double sb ) { sin_beta = sb; }
 
     double    cos_phi, sin_phi, cos_theta, sin_theta, cos_psi, sin_psi;
-    // inline double get_Cos_phi() const { return cos_phi; }
-    // inline void set_Cos_phi( double cp ) { cos_phi = cp; }
+    inline double get_Cos_phi() const { return cos_phi; }
+    inline void set_Cos_phi( double cp ) { cos_phi = cp; }
     // inline double get_Sin_phi() const { return sin_phi; }
     // inline void set_Sin_phi( double sp ) { sin_phi = sp; }
-    // inline double get_Cos_theta() const { return cos_theta; }
-    // inline void set_Cos_theta( double ct ) { cos_theta = ct; }
+    inline double get_Cos_theta() const { return cos_theta; }
+    inline void set_Cos_theta( double ct ) { cos_theta = ct; }
     // inline double get_Sin_theta() const { return sin_theta; }
     // inline void set_Sin_theta( double st ) { sin_theta = st; }
     // inline double get_Cos_psi() const { return cos_psi; }
@@ -687,17 +697,17 @@ public:
     double    sigma, density, v_sound, mach_number;
     // inline double get_Sigma() const { return sigma; }
     // inline void set_Sigma( double s ) { sigma = s; }
-    // inline double get_Density() const { return density; }
-    // inline void set_Density( double d ) { density = d; }
+    inline double get_Density() const { return density; }
+    inline void set_Density( double d ) { density = d; }
     // inline double get_V_sound() const { return v_sound; }
     // inline void set_V_sound( double v ) { v_sound = v; }
-    // inline double get_Mach_number() const { return mach_number; }
-    // inline void set_Mach_number( double m ) { mach_number = m; }
+    inline double get_Mach_number() const { return mach_number; }
+    inline void set_Mach_number( double m ) { mach_number = m; }
 
     double    static_pressure, total_pressure, impact_pressure;
     double    dynamic_pressure;
-    // inline double get_Static_pressure() const { return static_pressure; }
-    // inline void set_Static_pressure( double sp ) { static_pressure = sp; }
+    inline double get_Static_pressure() const { return static_pressure; }
+    inline void set_Static_pressure( double sp ) { static_pressure = sp; }
     // inline double get_Total_pressure() const { return total_pressure; }
     // inline void set_Total_pressure( double tp ) { total_pressure = tp; }
     // inline double get_Impact_pressure() const { return impact_pressure; }
@@ -706,8 +716,8 @@ public:
     // inline void set_Dynamic_pressure( double dp ) { dynamic_pressure = dp; }
 
     double    static_temperature, total_temperature;
-    // inline double get_Static_temperature() const { return static_temperature; }
-    // inline void set_Static_temperature( double t ) { static_temperature = t; }
+    inline double get_Static_temperature() const { return static_temperature; }
+    inline void set_Static_temperature( double t ) { static_temperature = t; }
     // inline double get_Total_temperature() const { return total_temperature; }
     // inline void set_Total_temperature( double t ) { total_temperature = t; }
 
@@ -851,7 +861,7 @@ typedef fdm_state_list::iterator fdm_state_list_iterator;
 typedef fdm_state_list::const_iterator const_fdm_state_list_iterator;
 
 
-extern FGInterface cur_fdm_state;
+extern FGInterface cur_fdm_state;
 
 
 // General interface to the flight model routines
@@ -870,5 +880,3 @@ void fgFDMSetGroundElevation(int model, double alt_meters);
 
 
 #endif // _FLIGHT_HXX
-
-