Harald JOHSNEN:
Changes ======= - correct the transparency probleme when old 3d clouds were enabled (rendering context with an alpha channel) - changed rain cone orientation, it can now be viewed from helicopter or chase view (still not tower view) - clouds are a bit more yellow/red at dawn/dusk - weather data is now correctly propagated to the interpolator, this correct visibility, wind, etc - the 'metar' weather scenario now immedialty reuse the real metar data - real metar no more overwrite custom weather scenario
This commit is contained in:
parent
56a9034d95
commit
e59d38bf00
5 changed files with 23 additions and 9 deletions
|
@ -494,7 +494,6 @@ FGMetarEnvironmentCtrl::update(double delta_time_sec)
|
||||||
result_queue.pop();
|
result_queue.pop();
|
||||||
if ( result.m != NULL ) {
|
if ( result.m != NULL ) {
|
||||||
update_metar_properties( result.m );
|
update_metar_properties( result.m );
|
||||||
fgSetString("/environment/metar/last-metar", result.m->getData());
|
|
||||||
delete result.m;
|
delete result.m;
|
||||||
update_env_config();
|
update_env_config();
|
||||||
env->reinit();
|
env->reinit();
|
||||||
|
@ -579,6 +578,11 @@ FGMetarEnvironmentCtrl::update_metar_properties( FGMetar *m )
|
||||||
double d;
|
double d;
|
||||||
char s[128];
|
char s[128];
|
||||||
|
|
||||||
|
fgSetString("/environment/metar/real-metar", m->getData());
|
||||||
|
// don't update with real weather when we use a custom weather scenario
|
||||||
|
if( strcmp(fgGetString("/environment/weather-scenario", "METAR"), "METAR") )
|
||||||
|
return;
|
||||||
|
fgSetString("/environment/metar/last-metar", m->getData());
|
||||||
fgSetString("/environment/metar/station-id", m->getId());
|
fgSetString("/environment/metar/station-id", m->getId());
|
||||||
fgSetDouble("/environment/metar/min-visibility-m",
|
fgSetDouble("/environment/metar/min-visibility-m",
|
||||||
m->getMinVisibility().getVisibility_m() );
|
m->getMinVisibility().getVisibility_m() );
|
||||||
|
|
|
@ -49,7 +49,7 @@ FGEnvironmentMgr::FGEnvironmentMgr ()
|
||||||
|
|
||||||
_controller->setEnvironment(_environment);
|
_controller->setEnvironment(_environment);
|
||||||
set_subsystem("controller", _controller, 0.5);
|
set_subsystem("controller", _controller, 0.5);
|
||||||
fgClouds = new FGClouds;
|
fgClouds = new FGClouds( _controller );
|
||||||
}
|
}
|
||||||
|
|
||||||
FGEnvironmentMgr::~FGEnvironmentMgr ()
|
FGEnvironmentMgr::~FGEnvironmentMgr ()
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include <Airports/simple.hxx>
|
#include <Airports/simple.hxx>
|
||||||
#include <Main/util.hxx>
|
#include <Main/util.hxx>
|
||||||
|
|
||||||
|
#include "environment_ctrl.hxx"
|
||||||
#include "environment_mgr.hxx"
|
#include "environment_mgr.hxx"
|
||||||
#include "fgmetar.hxx"
|
#include "fgmetar.hxx"
|
||||||
#include "fgclouds.hxx"
|
#include "fgclouds.hxx"
|
||||||
|
@ -40,8 +41,9 @@
|
||||||
extern SGSky *thesky;
|
extern SGSky *thesky;
|
||||||
|
|
||||||
|
|
||||||
FGClouds::FGClouds() :
|
FGClouds::FGClouds(FGEnvironmentCtrl * controller) :
|
||||||
station_elevation_ft(0.0),
|
station_elevation_ft(0.0),
|
||||||
|
_controller( controller ),
|
||||||
snd_lightning(NULL)
|
snd_lightning(NULL)
|
||||||
{
|
{
|
||||||
update_event = 0;
|
update_event = 0;
|
||||||
|
@ -413,6 +415,9 @@ void FGClouds::buildScenario( string scenario ) {
|
||||||
FGMetar *m = new FGMetar( station + fakeMetar );
|
FGMetar *m = new FGMetar( station + fakeMetar );
|
||||||
update_metar_properties( m );
|
update_metar_properties( m );
|
||||||
update_env_config();
|
update_env_config();
|
||||||
|
// propagate aloft tables
|
||||||
|
_controller->reinit();
|
||||||
|
|
||||||
fgSetString("/environment/metar/last-metar", m->getData());
|
fgSetString("/environment/metar/last-metar", m->getData());
|
||||||
// TODO:desactivate real metar updates
|
// TODO:desactivate real metar updates
|
||||||
if( scenario == "Fair weather" ) {
|
if( scenario == "Fair weather" ) {
|
||||||
|
@ -425,11 +430,14 @@ void FGClouds::build(void) {
|
||||||
string scenario = fgGetString("/environment/weather-scenario", "METAR");
|
string scenario = fgGetString("/environment/weather-scenario", "METAR");
|
||||||
|
|
||||||
if( scenario == "METAR" ) {
|
if( scenario == "METAR" ) {
|
||||||
string realMetar = fgGetString("/environment/metar/last-metar", "");
|
string realMetar = fgGetString("/environment/metar/real-metar", "");
|
||||||
if( realMetar != "" ) {
|
if( realMetar != "" ) {
|
||||||
|
fgSetString("/environment/metar/last-metar", realMetar.c_str());
|
||||||
FGMetar *m = new FGMetar( realMetar );
|
FGMetar *m = new FGMetar( realMetar );
|
||||||
update_metar_properties( m );
|
update_metar_properties( m );
|
||||||
update_env_config();
|
update_env_config();
|
||||||
|
// propagate aloft tables
|
||||||
|
_controller->reinit();
|
||||||
}
|
}
|
||||||
buildMETAR();
|
buildMETAR();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ SG_USING_STD(string);
|
||||||
class SGNewCloud;
|
class SGNewCloud;
|
||||||
class SGCloudField;
|
class SGCloudField;
|
||||||
class FGMetar;
|
class FGMetar;
|
||||||
|
class FGEnvironmentCtrl;
|
||||||
|
|
||||||
class FGClouds {
|
class FGClouds {
|
||||||
|
|
||||||
|
@ -56,11 +57,11 @@ private:
|
||||||
|
|
||||||
int update_event;
|
int update_event;
|
||||||
SGSoundSample *snd_lightning;
|
SGSoundSample *snd_lightning;
|
||||||
|
FGEnvironmentCtrl * _controller;
|
||||||
float station_elevation_ft;
|
float station_elevation_ft;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FGClouds();
|
FGClouds(FGEnvironmentCtrl * controller);
|
||||||
~FGClouds();
|
~FGClouds();
|
||||||
|
|
||||||
void build(void);
|
void build(void);
|
||||||
|
@ -72,4 +73,4 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _FGCLOUDS_HXX
|
#endif // _FGCLOUDS_HXX
|
||||||
|
|
|
@ -731,8 +731,9 @@ FGRenderer::update( bool refresh_camera_settings ) {
|
||||||
fgGetDouble("/environment/metar/rain-norm", 0.0),
|
fgGetDouble("/environment/metar/rain-norm", 0.0),
|
||||||
fgGetDouble("/environment/metar/snow-norm", 0.0),
|
fgGetDouble("/environment/metar/snow-norm", 0.0),
|
||||||
fgGetDouble("/environment/metar/hail-norm", 0.0),
|
fgGetDouble("/environment/metar/hail-norm", 0.0),
|
||||||
fgGetDouble("/orientation/pitch-deg", 0.0),
|
current__view->getPitch_deg() - current__view->getPitchOffset_deg(),
|
||||||
fgGetDouble("/orientation/roll-deg", 0.0),
|
current__view->getRoll_deg() + current__view->getRollOffset_deg(),
|
||||||
|
- current__view->getHeadingOffset_deg(),
|
||||||
fgGetDouble("/velocities/airspeed-kt", 0.0));
|
fgGetDouble("/velocities/airspeed-kt", 0.0));
|
||||||
|
|
||||||
if ( draw_otw ) {
|
if ( draw_otw ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue