1
0
Fork 0

Initial take of new environment subsystem. Configure with

--use-new-environment to active it.
This commit is contained in:
david 2002-02-19 15:16:08 +00:00
parent ac20cb7768
commit 71f120e3be
12 changed files with 46 additions and 46 deletions

View file

@ -65,7 +65,7 @@
#undef FG_NETWORK_OLK
/* 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) */
#undef FGFS

View file

@ -39,11 +39,11 @@ SG_USING_STD(cout);
//#include <simgear/misc/sgstream.hxx>
#include <simgear/misc/sg_path.hxx>
//#ifndef FG_OLD_WEATHER
//#ifndef FG_NEW_ENVIRONMENT
//sorry, that works only with the new weather system
#include <WeatherCM/FGLocalWeatherDatabase.h>
//#else
//# include <Weather/weather.hxx>
//# include <Environment/environment.hxx>
//#endif
#include <Main/fg_props.hxx>
@ -96,7 +96,7 @@ FGATIS::~FGATIS() {
string FGATIS::get_transmission() {
//void FGATIS::get_transmission() {
#if !defined(FG_OLD_WEATHER)
#if !defined(FG_NEW_ENVIRONMENT)
string transmission = "";
double visibility;
@ -220,6 +220,6 @@ string FGATIS::get_transmission() {
return(transmission);
#else
return "Station unavailable (not supported by FG_OLD_WEATHER)";
#endif // FG_OLD_WEATHER
return "Station unavailable (not supported by FG_NEW_ENVIRONMENT)";
#endif // FG_NEW_ENVIRONMENT
}

View file

@ -169,7 +169,7 @@ void balloon::update()
/* later, but currently was my main concern to get it going... */
/************************************************************************/
#ifndef FG_OLD_WEATHER
#ifndef FG_NEW_ENVIRONMENT
sgVec3 v;
FGPhysicalProperty wdbpos = WeatherDatabase->get(position);
@ -226,7 +226,7 @@ void balloon::update()
sgVec3 fTotal, fFriction, fLift;
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(fLift, gravity_vector, -balloon_envelope_volume * wdbpos.AirPressure / (287.14 * wdbpos.Temperature));
#endif

View file

@ -75,10 +75,10 @@
#include <simgear/misc/sg_path.hxx>
#include <Aircraft/aircraft.hxx>
#ifndef FG_OLD_WEATHER
#ifndef FG_NEW_ENVIRONMENT
#include <WeatherCM/FGLocalWeatherDatabase.h>
#else
#include <Weather/weather.hxx>
#include <Environment/environment.hxx>
#endif
#include "uiuc_aircraft.h"
@ -222,7 +222,7 @@ void uiuc_force_moment(double dt)
double vis;
if (Fog != 0)
{
#ifndef FG_OLD_WEATHER
#ifndef FG_NEW_ENVIRONMENT
vis = WeatherDatabase->getWeatherVisibility();
if (Fog > 0)
vis /= 1.01;
@ -230,12 +230,12 @@ void uiuc_force_moment(double dt)
vis *= 1.01;
WeatherDatabase->setWeatherVisibility( vis );
#else
vis = current_weather.get_visibility_m();
vis = current_environment.get_visibility_m();
if (Fog > 0)
vis /= 1.01;
else
vis *= 1.01;
current_weather.set_visibility_m( vis );
current_environment.set_visibility_m( vis );
#endif
}

View file

@ -55,10 +55,10 @@
#include <Cockpit/panel_io.hxx>
#include <GUI/gui.h>
#ifndef FG_OLD_WEATHER
#ifndef FG_NEW_ENVIRONMENT
# include <WeatherCM/FGLocalWeatherDatabase.h>
#else
# include <Weather/weather.hxx>
# include <Environment/environment.hxx>
#endif
#include <Main/globals.hxx>

View file

@ -4,8 +4,8 @@ else
SERIAL_LIBS =
endif
if ENABLE_OLD_WEATHER
WEATHER_LIBS = $(top_builddir)/src/Weather/libWeather.a
if ENABLE_NEW_ENVIRONMENT
WEATHER_LIBS = $(top_builddir)/src/Environment/libEnvironment.a
else
WEATHER_LIBS = $(top_builddir)/src/WeatherCM/libWeatherCM.a
endif

View file

@ -102,10 +102,10 @@
#include <Time/moonpos.hxx>
#include <Time/tmp.hxx>
#ifndef FG_OLD_WEATHER
#ifndef FG_NEW_ENVIRONMENT
# include <WeatherCM/FGLocalWeatherDatabase.h>
#else
# include <Weather/weather.hxx>
# include <Environment/environment.hxx>
#endif
#include "fg_init.hxx"
@ -764,7 +764,7 @@ bool fgInitSubsystems( void ) {
////////////////////////////////////////////////////////////////////
// Initialize the weather modeling subsystem
#ifndef FG_OLD_WEATHER
#ifndef FG_NEW_ENVIRONMENT
// Initialize the WeatherDatabase
SG_LOG(SG_GENERAL, SG_INFO, "Creating LocalWeatherDatabase");
sgVec3 position;
@ -805,8 +805,8 @@ bool fgInitSubsystems( void ) {
global_events.Register( "weather update", fgUpdateWeatherDatabase,
fgEVENT::FG_EVENT_READY, 30000);
#else
current_weather.init();
current_weather.bind();
current_environment.init();
current_environment.bind();
#endif
////////////////////////////////////////////////////////////////////

View file

@ -33,11 +33,11 @@
#include <Aircraft/aircraft.hxx>
#include <Time/tmp.hxx>
#include <FDM/UIUCModel/uiuc_aircraftdir.h>
#ifndef FG_OLD_WEATHER
#ifndef FG_NEW_ENVIRONMENT
# include <WeatherCM/FGLocalWeatherDatabase.h>
#else
# include <Weather/weather.hxx>
#endif // FG_OLD_WEATHER
# include <Environment/environment.hxx>
#endif // FG_NEW_ENVIRONMENT
#include <Objects/matlib.hxx>
#include <GUI/gui.h>
@ -52,11 +52,11 @@ SG_USING_STD(istream);
SG_USING_STD(ostream);
#endif
#if !defined(FG_OLD_WEATHER)
#if !defined(FG_NEW_ENVIRONMENT)
static double getWindNorth ();
static double getWindEast ();
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)
// 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).
@ -976,7 +976,7 @@ setWindDown (double speed)
speed);
}
#endif // FG_OLD_WEATHER
#endif // FG_NEW_ENVIRONMENT
static double
getFOV ()
@ -1152,7 +1152,7 @@ fgInitProps ()
fgSetArchivable("/autopilot/control-overrides/throttle");
// Environment
#if !defined(FG_OLD_WEATHER)
#if !defined(FG_NEW_ENVIRONMENT)
fgTie("/environment/visibility-m", getVisibility, setVisibility);
fgSetArchivable("/environment/visibility-m");
fgTie("/environment/wind-north-fps", getWindNorth, setWindNorth);

View file

@ -136,10 +136,10 @@ FGTileEntry *dummy_tile;
sgVec3 rway_ols;
// ADA
#ifndef FG_OLD_WEATHER
#ifndef FG_NEW_ENVIRONMENT
# include <WeatherCM/FGLocalWeatherDatabase.h>
#else
# include <Weather/weather.hxx>
# include <Environment/environment.hxx>
#endif
#include "version.h"
@ -553,10 +553,10 @@ void fgRenderFrame( void ) {
default_state->force();
// update fog params if visibility has changed
#ifndef FG_OLD_WEATHER
#ifndef FG_NEW_ENVIRONMENT
thesky->set_visibility( WeatherDatabase->getWeatherVisibility() );
#else
thesky->set_visibility( current_weather.get_visibility_m() );
thesky->set_visibility( current_environment.get_visibility_m() );
#endif
thesky->modify_vis( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER,
@ -674,7 +674,7 @@ void fgRenderFrame( void ) {
- scenery.get_cur_elev();
// SG_LOG( SG_ALL, SG_INFO, "visibility is "
// << current_weather.get_visibility() );
// << current_environment.get_visibility() );
if ( agl > 10.0 ) {
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.
#endif
#ifdef FG_OLD_WEATHER
current_weather.update(0); // FIXME: use real delta time
#ifdef FG_NEW_ENVIRONMENT
current_environment.update(0); // FIXME: use real delta time
#endif
// Fix elevation. I'm just sticking this here for now, it should

View file

@ -1,5 +1,5 @@
if ENABLE_OLD_WEATHER
WEATHER_DIR = Weather
if ENABLE_NEW_ENVIRONMENT
WEATHER_DIR = Environment
else
WEATHER_DIR = WeatherCM
endif

View file

@ -44,10 +44,10 @@
#include <Main/viewer.hxx>
#include <Objects/obj.hxx>
#ifndef FG_OLD_WEATHER
#ifndef FG_NEW_ENVIRONMENT
# include <WeatherCM/FGLocalWeatherDatabase.h>
#else
# include <Weather/weather.hxx>
# include <Environment/environment.hxx>
#endif
#include "newcache.hxx"
@ -168,14 +168,14 @@ void FGTileMgr::schedule_needed() {
SG_LOG( SG_TERRAIN, SG_INFO,
"scheduling needed tiles for " << longitude << " " << latitude );
#ifndef FG_OLD_WEATHER
#ifndef FG_NEW_ENVIRONMENT
if ( WeatherDatabase != NULL ) {
vis = WeatherDatabase->getWeatherVisibility();
} else {
vis = 16000;
}
#else
vis = current_weather.get_visibility_m();
vis = current_environment.get_visibility_m();
#endif
// cout << "visibility = " << vis << endl;
@ -409,14 +409,14 @@ int FGTileMgr::update( double lon, double lat ) {
void FGTileMgr::prep_ssg_nodes() {
float vis = 0.0;
#ifndef FG_OLD_WEATHER
#ifndef FG_NEW_ENVIRONMENT
if ( WeatherDatabase ) {
vis = WeatherDatabase->getWeatherVisibility();
} else {
vis = 16000;
}
#else
vis = current_weather.get_visibility_m();
vis = current_environment.get_visibility_m();
#endif
// cout << "visibility = " << vis << endl;

View file

@ -39,7 +39,7 @@
#include <Main/fg_props.hxx>
#include <Aircraft/aircraft.hxx>
#include <Weather/weather.hxx>
#include <Environment/environment.hxx>
// This is a record containing current weather info