1
0
Fork 0

Add the climate class to the build, for now it's not altering anything.

This commit is contained in:
Erik Hofman 2020-11-03 14:41:38 +01:00
parent 9481ac4595
commit 04ff8a5e5e
4 changed files with 13 additions and 2 deletions

View file

@ -6,6 +6,7 @@ set(SOURCES
environment_ctrl.cxx
environment_mgr.cxx
ephemeris.cxx
climate.cxx
fgclouds.cxx
fgmetar.cxx
metarairportfilter.cxx
@ -26,6 +27,7 @@ set(HEADERS
environment_mgr.hxx
ephemeris.hxx
fgclouds.hxx
climate.hxx
fgmetar.hxx
metarairportfilter.hxx
metarproperties.hxx

View file

@ -99,7 +99,7 @@ void FGClimate::update_day_factor()
else if (lon < 0.0) lon += 360.0;
// noon is when lon == 180.0
_day_noon = 1.0 - (fabs(lon) - 180.0)/180.0;
_day_noon = 1.0 - fabs(lon - 180.0)/180.0;
}
// The seasons are currently based purely on where the sun's perpendicular

View file

@ -48,6 +48,7 @@
#include "terrainsampler.hxx"
#include "Airports/airport.hxx"
#include "gravity.hxx"
#include "climate.hxx"
#include "magvarmanager.hxx"
class FG3DCloudsListener : public SGPropertyChangeListener {
@ -109,6 +110,7 @@ FGEnvironmentMgr::~FGEnvironmentMgr ()
delete fgClouds;
delete _3dCloudsEnableListener;
delete _environment;
delete _climate;
}
struct FGEnvironmentMgrMultiplayerListener : SGPropertyChangeListener {
@ -260,9 +262,14 @@ FGEnvironmentMgr::update (double dt)
{
SGSubsystemGroup::update(dt);
SGGeod aircraftPos(globals->get_aircraft_position());
SGGeod aircraftPos(globals->get_aircraft_position());
_environment->set_elevation_ft( aircraftPos.getElevationFt() );
if (!_climate)
_climate = new FGClimate(aircraftPos);
else
_climate->update(aircraftPos);
auto particlesManager = simgear::ParticlesGlobalManager::instance();
particlesManager->setWindFrom(_environment->get_wind_from_heading_deg(),
_environment->get_wind_speed_kt());

View file

@ -29,6 +29,7 @@
#include <cmath>
class FGEnvironment;
class FGClimate;
class FGClouds;
class FGPrecipitationMgr;
class SGSky;
@ -92,6 +93,7 @@ private:
double get_cloud_layer_maxalpha (int index ) const;
void set_cloud_layer_maxalpha (int index, double maxalpha);
FGClimate * _climate = nullptr;
FGEnvironment * _environment = nullptr; // always the same, for now
FGClouds *fgClouds = nullptr;
bool _cloudLayersDirty = true;