// Inform LaRCsim of the local terrain altitude
Runway_altitude = get_Runway_altitude();
+ // Weather
+ V_north_airmass = get_V_north_airmass();
+ V_east_airmass = get_V_east_airmass();
+ V_down_airmass = get_V_down_airmass();
+
// old -- FGInterface_2_LaRCsim() not needed except for Init()
// translate FG to LaRCsim structure
// FGInterface_2_LaRCsim(f);
// set_Gamma_horiz_rad( Gamma_horiz_rad );
// set_Sigma( Sigma );
- // set_Density( Density );
+ set_Density( Density );
// set_V_sound( V_sound );
// set_Mach_number( Mach_number );
- // set_Static_pressure( Static_pressure );
+ set_Static_pressure( Static_pressure );
// set_Total_pressure( Total_pressure );
// set_Impact_pressure( Impact_pressure );
// set_Dynamic_pressure( Dynamic_pressure );
- // set_Static_temperature( Static_temperature );
+ set_Static_temperature( Static_temperature );
// set_Total_temperature( Total_temperature );
set_Sea_level_radius( Sea_level_radius );
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
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; }
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; }
};
*/
+extern void fgHUDalphaAdjust( puObject * );
char *viewSubmenu [] = {
- /* "Cockpit View > ", "View >","------------", */ "Toggle Panel...", NULL
+ "HUD Alpha",
+ /* "Cockpit View > ", "View >","------------", */
+ "Toggle Panel...", NULL
};
puCallback viewSubmenuCb [] = {
- /* notCb, notCb, NULL, */ guiTogglePanel, NULL
+ fgHUDalphaAdjust,
+ /* notCb, notCb, NULL, */
+ guiTogglePanel, NULL
};
char *aircraftSubmenu [] = {
void fgUpdateWeatherDatabase(void)
{
sgVec3 position;
- sgSetVec3(position,
+ sgVec3 wind;
+
+
+ sgSetVec3(position,
current_aircraft.fdm_state->get_Latitude(),
current_aircraft.fdm_state->get_Longitude(),
current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER);
WeatherDatabase->update( position );
+
+ #define rho0 1.293 /*for air in normal altitudes*/
+ #define PATOPSF 0.02089 // Pascals to psf
+ #define KTOR 1.8 // Kelvin to degree Rankine
+ #define KGMTOSGF 0.0019403 // kg/m^3 to slug/ft^3
+
+
+ FGPhysicalProperty my_value = WeatherDatabase->get(position);
+ current_aircraft.fdm_state->set_Static_temperature(my_value.Temperature*KTOR);
+ current_aircraft.fdm_state->set_Static_pressure(my_value.AirPressure*PATOPSF);
+ float density=rho0 * 273.15 * my_value.AirPressure / (101300 *my_value.Temperature )*KGMTOSGF;
+ current_aircraft.fdm_state->set_Density(density*KGMTOSGF);
+
+ #define KPHTOFPS 0.9113 //km/hr to ft/s
+ #define MSTOFPS 3.2808 //m/s to ft/s
+ current_aircraft.fdm_state->set_Velocities_Local_Airmass(my_value.Wind[1]*KPHTOFPS,
+ my_value.Wind[0]*KPHTOFPS,
+ my_value.Wind[2]*KPHTOFPS);
+
}