*/
-#include <Include/compiler.h>
+#include <simgear/compiler.h>
#include <math.h>
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,
// 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.
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; }
- // inline double get_U_dot_body() const { return v_dot_body_v[0]; }
- // inline double get_V_dot_body() const { return v_dot_body_v[1]; }
- // inline double get_W_dot_body() const { return v_dot_body_v[2]; }
- /* inline void set_Accels_Body( double u, double v, double w ) {
- v_dot_local_v[0] = u;
- v_dot_local_v[1] = v;
- v_dot_local_v[2] = w;
- } */
+ inline double get_U_dot_body() const { return v_dot_body_v[0]; }
+ inline double get_V_dot_body() const { return v_dot_body_v[1]; }
+ inline double get_W_dot_body() const { return v_dot_body_v[2]; }
+ inline void set_Accels_Body( double u, double v, double w ) {
+ v_dot_body_v[0] = u;
+ v_dot_body_v[1] = v;
+ v_dot_body_v[2] = w;
+ }
FG_VECTOR_3 a_cg_body_v;
// inline double * get_A_cg_body_v() { return a_cg_body_v; }
- // inline double get_A_X_cg() const { return a_cg_body_v[0]; }
- // inline double get_A_Y_cg() const { return a_cg_body_v[1]; }
- // inline double get_A_Z_cg() const { return a_cg_body_v[2]; }
- /* inline void set_Accels_CG_Body( double x, double y, double z ) {
+ inline double get_A_X_cg() const { return a_cg_body_v[0]; }
+ inline double get_A_Y_cg() const { return a_cg_body_v[1]; }
+ inline double get_A_Z_cg() const { return a_cg_body_v[2]; }
+ inline void set_Accels_CG_Body( double x, double y, double z ) {
a_cg_body_v[0] = x;
a_cg_body_v[1] = y;
a_cg_body_v[2] = z;
- } */
+ }
FG_VECTOR_3 a_pilot_body_v;
// inline double * get_A_pilot_body_v() { return a_pilot_body_v; }
- // inline double get_A_X_pilot() const { return a_pilot_body_v[0]; }
- // inline double get_A_Y_pilot() const { return a_pilot_body_v[1]; }
- // inline double get_A_Z_pilot() const { return a_pilot_body_v[2]; }
- /* inline void set_Accels_Pilot_Body( double x, double y, double z ) {
+ inline double get_A_X_pilot() const { return a_pilot_body_v[0]; }
+ inline double get_A_Y_pilot() const { return a_pilot_body_v[1]; }
+ inline double get_A_Z_pilot() const { return a_pilot_body_v[2]; }
+ inline void set_Accels_Pilot_Body( double x, double y, double z ) {
a_pilot_body_v[0] = x;
a_pilot_body_v[1] = y;
a_pilot_body_v[2] = z;
- } */
+ }
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; }
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
FG_VECTOR_3 v_wind_body_v; // Wind-relative velocities in body axis
// inline double * get_V_wind_body_v() { return v_wind_body_v; }
- // inline double get_U_body() const { return v_wind_body_v[0]; }
- // inline double get_V_body() const { return v_wind_body_v[1]; }
- // inline double get_W_body() const { return v_wind_body_v[2]; }
- /* inline void set_Velocities_Wind_Body( double u, double v, double w)
+ inline double get_U_body() const { return v_wind_body_v[0]; }
+ inline double get_V_body() const { return v_wind_body_v[1]; }
+ inline double get_W_body() const { return v_wind_body_v[2]; }
+ inline void set_Velocities_Wind_Body( double u, double v, double w)
{
v_wind_body_v[0] = u;
v_wind_body_v[1] = v;
v_wind_body_v[2] = w;
- } */
+ }
double v_rel_wind, v_true_kts, v_rel_ground, v_inertial;
double v_ground_speed, v_equiv, v_equiv_kts;
// 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; }
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; }
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; }
// 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; }
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; }
// 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; }
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
#endif // _FLIGHT_HXX
-
-