Initial take of new environment subsystem. Configure with
--use-new-environment to active it.
This commit is contained in:
parent
ac20cb7768
commit
71f120e3be
12 changed files with 46 additions and 46 deletions
|
@ -65,7 +65,7 @@
|
||||||
#undef FG_NETWORK_OLK
|
#undef FG_NETWORK_OLK
|
||||||
|
|
||||||
/* Define to avoid Christian's new weather code */
|
/* Define to avoid Christian's new weather code */
|
||||||
#undef FG_OLD_WEATHER
|
#undef FG_NEW_ENVIRONMENT
|
||||||
|
|
||||||
/* Define if we are building FGFS (should always be defined) */
|
/* Define if we are building FGFS (should always be defined) */
|
||||||
#undef FGFS
|
#undef FGFS
|
||||||
|
|
|
@ -39,11 +39,11 @@ SG_USING_STD(cout);
|
||||||
//#include <simgear/misc/sgstream.hxx>
|
//#include <simgear/misc/sgstream.hxx>
|
||||||
#include <simgear/misc/sg_path.hxx>
|
#include <simgear/misc/sg_path.hxx>
|
||||||
|
|
||||||
//#ifndef FG_OLD_WEATHER
|
//#ifndef FG_NEW_ENVIRONMENT
|
||||||
//sorry, that works only with the new weather system
|
//sorry, that works only with the new weather system
|
||||||
#include <WeatherCM/FGLocalWeatherDatabase.h>
|
#include <WeatherCM/FGLocalWeatherDatabase.h>
|
||||||
//#else
|
//#else
|
||||||
//# include <Weather/weather.hxx>
|
//# include <Environment/environment.hxx>
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
#include <Main/fg_props.hxx>
|
#include <Main/fg_props.hxx>
|
||||||
|
@ -96,7 +96,7 @@ FGATIS::~FGATIS() {
|
||||||
|
|
||||||
string FGATIS::get_transmission() {
|
string FGATIS::get_transmission() {
|
||||||
//void FGATIS::get_transmission() {
|
//void FGATIS::get_transmission() {
|
||||||
#if !defined(FG_OLD_WEATHER)
|
#if !defined(FG_NEW_ENVIRONMENT)
|
||||||
|
|
||||||
string transmission = "";
|
string transmission = "";
|
||||||
double visibility;
|
double visibility;
|
||||||
|
@ -220,6 +220,6 @@ string FGATIS::get_transmission() {
|
||||||
|
|
||||||
return(transmission);
|
return(transmission);
|
||||||
#else
|
#else
|
||||||
return "Station unavailable (not supported by FG_OLD_WEATHER)";
|
return "Station unavailable (not supported by FG_NEW_ENVIRONMENT)";
|
||||||
#endif // FG_OLD_WEATHER
|
#endif // FG_NEW_ENVIRONMENT
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ void balloon::update()
|
||||||
/* later, but currently was my main concern to get it going... */
|
/* later, but currently was my main concern to get it going... */
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
sgVec3 v;
|
sgVec3 v;
|
||||||
|
|
||||||
FGPhysicalProperty wdbpos = WeatherDatabase->get(position);
|
FGPhysicalProperty wdbpos = WeatherDatabase->get(position);
|
||||||
|
@ -226,7 +226,7 @@ void balloon::update()
|
||||||
sgVec3 fTotal, fFriction, fLift;
|
sgVec3 fTotal, fFriction, fLift;
|
||||||
|
|
||||||
sgScaleVec3(fTotal, gravity_vector, mTotal);
|
sgScaleVec3(fTotal, gravity_vector, mTotal);
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
sgScaleVec3(fFriction, v, cw_envelope * wind_facing_area_of_balloon * WeatherDatabase->getAirDensity(position) * speed / 2.0); //wind resistance
|
sgScaleVec3(fFriction, v, cw_envelope * wind_facing_area_of_balloon * WeatherDatabase->getAirDensity(position) * speed / 2.0); //wind resistance
|
||||||
sgScaleVec3(fLift, gravity_vector, -balloon_envelope_volume * wdbpos.AirPressure / (287.14 * wdbpos.Temperature));
|
sgScaleVec3(fLift, gravity_vector, -balloon_envelope_volume * wdbpos.AirPressure / (287.14 * wdbpos.Temperature));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -75,10 +75,10 @@
|
||||||
#include <simgear/misc/sg_path.hxx>
|
#include <simgear/misc/sg_path.hxx>
|
||||||
#include <Aircraft/aircraft.hxx>
|
#include <Aircraft/aircraft.hxx>
|
||||||
|
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
#include <WeatherCM/FGLocalWeatherDatabase.h>
|
#include <WeatherCM/FGLocalWeatherDatabase.h>
|
||||||
#else
|
#else
|
||||||
#include <Weather/weather.hxx>
|
#include <Environment/environment.hxx>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "uiuc_aircraft.h"
|
#include "uiuc_aircraft.h"
|
||||||
|
@ -222,7 +222,7 @@ void uiuc_force_moment(double dt)
|
||||||
double vis;
|
double vis;
|
||||||
if (Fog != 0)
|
if (Fog != 0)
|
||||||
{
|
{
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
vis = WeatherDatabase->getWeatherVisibility();
|
vis = WeatherDatabase->getWeatherVisibility();
|
||||||
if (Fog > 0)
|
if (Fog > 0)
|
||||||
vis /= 1.01;
|
vis /= 1.01;
|
||||||
|
@ -230,12 +230,12 @@ void uiuc_force_moment(double dt)
|
||||||
vis *= 1.01;
|
vis *= 1.01;
|
||||||
WeatherDatabase->setWeatherVisibility( vis );
|
WeatherDatabase->setWeatherVisibility( vis );
|
||||||
#else
|
#else
|
||||||
vis = current_weather.get_visibility_m();
|
vis = current_environment.get_visibility_m();
|
||||||
if (Fog > 0)
|
if (Fog > 0)
|
||||||
vis /= 1.01;
|
vis /= 1.01;
|
||||||
else
|
else
|
||||||
vis *= 1.01;
|
vis *= 1.01;
|
||||||
current_weather.set_visibility_m( vis );
|
current_environment.set_visibility_m( vis );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,10 +55,10 @@
|
||||||
#include <Cockpit/panel_io.hxx>
|
#include <Cockpit/panel_io.hxx>
|
||||||
#include <GUI/gui.h>
|
#include <GUI/gui.h>
|
||||||
|
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
# include <WeatherCM/FGLocalWeatherDatabase.h>
|
# include <WeatherCM/FGLocalWeatherDatabase.h>
|
||||||
#else
|
#else
|
||||||
# include <Weather/weather.hxx>
|
# include <Environment/environment.hxx>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <Main/globals.hxx>
|
#include <Main/globals.hxx>
|
||||||
|
|
|
@ -4,8 +4,8 @@ else
|
||||||
SERIAL_LIBS =
|
SERIAL_LIBS =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if ENABLE_OLD_WEATHER
|
if ENABLE_NEW_ENVIRONMENT
|
||||||
WEATHER_LIBS = $(top_builddir)/src/Weather/libWeather.a
|
WEATHER_LIBS = $(top_builddir)/src/Environment/libEnvironment.a
|
||||||
else
|
else
|
||||||
WEATHER_LIBS = $(top_builddir)/src/WeatherCM/libWeatherCM.a
|
WEATHER_LIBS = $(top_builddir)/src/WeatherCM/libWeatherCM.a
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -102,10 +102,10 @@
|
||||||
#include <Time/moonpos.hxx>
|
#include <Time/moonpos.hxx>
|
||||||
#include <Time/tmp.hxx>
|
#include <Time/tmp.hxx>
|
||||||
|
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
# include <WeatherCM/FGLocalWeatherDatabase.h>
|
# include <WeatherCM/FGLocalWeatherDatabase.h>
|
||||||
#else
|
#else
|
||||||
# include <Weather/weather.hxx>
|
# include <Environment/environment.hxx>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "fg_init.hxx"
|
#include "fg_init.hxx"
|
||||||
|
@ -764,7 +764,7 @@ bool fgInitSubsystems( void ) {
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Initialize the weather modeling subsystem
|
// Initialize the weather modeling subsystem
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
// Initialize the WeatherDatabase
|
// Initialize the WeatherDatabase
|
||||||
SG_LOG(SG_GENERAL, SG_INFO, "Creating LocalWeatherDatabase");
|
SG_LOG(SG_GENERAL, SG_INFO, "Creating LocalWeatherDatabase");
|
||||||
sgVec3 position;
|
sgVec3 position;
|
||||||
|
@ -805,8 +805,8 @@ bool fgInitSubsystems( void ) {
|
||||||
global_events.Register( "weather update", fgUpdateWeatherDatabase,
|
global_events.Register( "weather update", fgUpdateWeatherDatabase,
|
||||||
fgEVENT::FG_EVENT_READY, 30000);
|
fgEVENT::FG_EVENT_READY, 30000);
|
||||||
#else
|
#else
|
||||||
current_weather.init();
|
current_environment.init();
|
||||||
current_weather.bind();
|
current_environment.bind();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -33,11 +33,11 @@
|
||||||
#include <Aircraft/aircraft.hxx>
|
#include <Aircraft/aircraft.hxx>
|
||||||
#include <Time/tmp.hxx>
|
#include <Time/tmp.hxx>
|
||||||
#include <FDM/UIUCModel/uiuc_aircraftdir.h>
|
#include <FDM/UIUCModel/uiuc_aircraftdir.h>
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
# include <WeatherCM/FGLocalWeatherDatabase.h>
|
# include <WeatherCM/FGLocalWeatherDatabase.h>
|
||||||
#else
|
#else
|
||||||
# include <Weather/weather.hxx>
|
# include <Environment/environment.hxx>
|
||||||
#endif // FG_OLD_WEATHER
|
#endif // FG_NEW_ENVIRONMENT
|
||||||
#include <Objects/matlib.hxx>
|
#include <Objects/matlib.hxx>
|
||||||
|
|
||||||
#include <GUI/gui.h>
|
#include <GUI/gui.h>
|
||||||
|
@ -52,11 +52,11 @@ SG_USING_STD(istream);
|
||||||
SG_USING_STD(ostream);
|
SG_USING_STD(ostream);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(FG_OLD_WEATHER)
|
#if !defined(FG_NEW_ENVIRONMENT)
|
||||||
static double getWindNorth ();
|
static double getWindNorth ();
|
||||||
static double getWindEast ();
|
static double getWindEast ();
|
||||||
static double getWindDown ();
|
static double getWindDown ();
|
||||||
#endif // FG_OLD_WEATHER
|
#endif // FG_NEW_ENVIRONMENT
|
||||||
|
|
||||||
// Allow the view to be set from two axes (i.e. a joystick hat)
|
// Allow the view to be set from two axes (i.e. a joystick hat)
|
||||||
// This needs to be in FGViewer itself, somehow.
|
// This needs to be in FGViewer itself, somehow.
|
||||||
|
@ -890,7 +890,7 @@ setAPThrottleControl (double value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if !defined(FG_OLD_WEATHER)
|
#if !defined(FG_NEW_ENVIRONMENT)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current visibility (meters).
|
* Get the current visibility (meters).
|
||||||
|
@ -976,7 +976,7 @@ setWindDown (double speed)
|
||||||
speed);
|
speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // FG_OLD_WEATHER
|
#endif // FG_NEW_ENVIRONMENT
|
||||||
|
|
||||||
static double
|
static double
|
||||||
getFOV ()
|
getFOV ()
|
||||||
|
@ -1152,7 +1152,7 @@ fgInitProps ()
|
||||||
fgSetArchivable("/autopilot/control-overrides/throttle");
|
fgSetArchivable("/autopilot/control-overrides/throttle");
|
||||||
|
|
||||||
// Environment
|
// Environment
|
||||||
#if !defined(FG_OLD_WEATHER)
|
#if !defined(FG_NEW_ENVIRONMENT)
|
||||||
fgTie("/environment/visibility-m", getVisibility, setVisibility);
|
fgTie("/environment/visibility-m", getVisibility, setVisibility);
|
||||||
fgSetArchivable("/environment/visibility-m");
|
fgSetArchivable("/environment/visibility-m");
|
||||||
fgTie("/environment/wind-north-fps", getWindNorth, setWindNorth);
|
fgTie("/environment/wind-north-fps", getWindNorth, setWindNorth);
|
||||||
|
|
|
@ -136,10 +136,10 @@ FGTileEntry *dummy_tile;
|
||||||
sgVec3 rway_ols;
|
sgVec3 rway_ols;
|
||||||
// ADA
|
// ADA
|
||||||
|
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
# include <WeatherCM/FGLocalWeatherDatabase.h>
|
# include <WeatherCM/FGLocalWeatherDatabase.h>
|
||||||
#else
|
#else
|
||||||
# include <Weather/weather.hxx>
|
# include <Environment/environment.hxx>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
@ -553,10 +553,10 @@ void fgRenderFrame( void ) {
|
||||||
default_state->force();
|
default_state->force();
|
||||||
|
|
||||||
// update fog params if visibility has changed
|
// update fog params if visibility has changed
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
thesky->set_visibility( WeatherDatabase->getWeatherVisibility() );
|
thesky->set_visibility( WeatherDatabase->getWeatherVisibility() );
|
||||||
#else
|
#else
|
||||||
thesky->set_visibility( current_weather.get_visibility_m() );
|
thesky->set_visibility( current_environment.get_visibility_m() );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
thesky->modify_vis( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER,
|
thesky->modify_vis( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER,
|
||||||
|
@ -674,7 +674,7 @@ void fgRenderFrame( void ) {
|
||||||
- scenery.get_cur_elev();
|
- scenery.get_cur_elev();
|
||||||
|
|
||||||
// SG_LOG( SG_ALL, SG_INFO, "visibility is "
|
// SG_LOG( SG_ALL, SG_INFO, "visibility is "
|
||||||
// << current_weather.get_visibility() );
|
// << current_environment.get_visibility() );
|
||||||
|
|
||||||
if ( agl > 10.0 ) {
|
if ( agl > 10.0 ) {
|
||||||
ssgSetNearFar( 10.0f, 120000.0f );
|
ssgSetNearFar( 10.0f, 120000.0f );
|
||||||
|
@ -1042,8 +1042,8 @@ static void fgMainLoop( void ) {
|
||||||
// init routine and we don't have to worry about it again.
|
// init routine and we don't have to worry about it again.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FG_OLD_WEATHER
|
#ifdef FG_NEW_ENVIRONMENT
|
||||||
current_weather.update(0); // FIXME: use real delta time
|
current_environment.update(0); // FIXME: use real delta time
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Fix elevation. I'm just sticking this here for now, it should
|
// Fix elevation. I'm just sticking this here for now, it should
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if ENABLE_OLD_WEATHER
|
if ENABLE_NEW_ENVIRONMENT
|
||||||
WEATHER_DIR = Weather
|
WEATHER_DIR = Environment
|
||||||
else
|
else
|
||||||
WEATHER_DIR = WeatherCM
|
WEATHER_DIR = WeatherCM
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -44,10 +44,10 @@
|
||||||
#include <Main/viewer.hxx>
|
#include <Main/viewer.hxx>
|
||||||
#include <Objects/obj.hxx>
|
#include <Objects/obj.hxx>
|
||||||
|
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
# include <WeatherCM/FGLocalWeatherDatabase.h>
|
# include <WeatherCM/FGLocalWeatherDatabase.h>
|
||||||
#else
|
#else
|
||||||
# include <Weather/weather.hxx>
|
# include <Environment/environment.hxx>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "newcache.hxx"
|
#include "newcache.hxx"
|
||||||
|
@ -168,14 +168,14 @@ void FGTileMgr::schedule_needed() {
|
||||||
SG_LOG( SG_TERRAIN, SG_INFO,
|
SG_LOG( SG_TERRAIN, SG_INFO,
|
||||||
"scheduling needed tiles for " << longitude << " " << latitude );
|
"scheduling needed tiles for " << longitude << " " << latitude );
|
||||||
|
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
if ( WeatherDatabase != NULL ) {
|
if ( WeatherDatabase != NULL ) {
|
||||||
vis = WeatherDatabase->getWeatherVisibility();
|
vis = WeatherDatabase->getWeatherVisibility();
|
||||||
} else {
|
} else {
|
||||||
vis = 16000;
|
vis = 16000;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
vis = current_weather.get_visibility_m();
|
vis = current_environment.get_visibility_m();
|
||||||
#endif
|
#endif
|
||||||
// cout << "visibility = " << vis << endl;
|
// cout << "visibility = " << vis << endl;
|
||||||
|
|
||||||
|
@ -409,14 +409,14 @@ int FGTileMgr::update( double lon, double lat ) {
|
||||||
void FGTileMgr::prep_ssg_nodes() {
|
void FGTileMgr::prep_ssg_nodes() {
|
||||||
float vis = 0.0;
|
float vis = 0.0;
|
||||||
|
|
||||||
#ifndef FG_OLD_WEATHER
|
#ifndef FG_NEW_ENVIRONMENT
|
||||||
if ( WeatherDatabase ) {
|
if ( WeatherDatabase ) {
|
||||||
vis = WeatherDatabase->getWeatherVisibility();
|
vis = WeatherDatabase->getWeatherVisibility();
|
||||||
} else {
|
} else {
|
||||||
vis = 16000;
|
vis = 16000;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
vis = current_weather.get_visibility_m();
|
vis = current_environment.get_visibility_m();
|
||||||
#endif
|
#endif
|
||||||
// cout << "visibility = " << vis << endl;
|
// cout << "visibility = " << vis << endl;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
#include <Main/fg_props.hxx>
|
#include <Main/fg_props.hxx>
|
||||||
#include <Aircraft/aircraft.hxx>
|
#include <Aircraft/aircraft.hxx>
|
||||||
#include <Weather/weather.hxx>
|
#include <Environment/environment.hxx>
|
||||||
|
|
||||||
|
|
||||||
// This is a record containing current weather info
|
// This is a record containing current weather info
|
||||||
|
|
Loading…
Add table
Reference in a new issue