From 8b72e13d2f2d4a101f8cc29c208512a6614ed411 Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Sat, 4 Jun 2011 15:39:45 +0200 Subject: [PATCH] As torten explains: it is probably not a good idea to ti /environment/relative-humidity since the FGEnvironment ties to this property too --- src/Time/light.cxx | 5 ++--- src/Time/light.hxx | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Time/light.cxx b/src/Time/light.cxx index 99c8e5b65..861c496e9 100644 --- a/src/Time/light.cxx +++ b/src/Time/light.cxx @@ -76,7 +76,6 @@ FGLight::FGLight () _cloud_color(0, 0, 0, 0), _adj_fog_color(0, 0, 0, 0), _adj_sky_color(0, 0, 0, 0), - _humidity(69.5), _saturation(1.0), _scattering(0.8), _dt_total(0) @@ -146,7 +145,6 @@ void FGLight::bind () { // Write Only prop->tie("/rendering/scene/saturation",SGRawValuePointer(&_saturation)); prop->tie("/rendering/scene/scattering",SGRawValuePointer(&_scattering)); - prop->tie("/environment/relative-humidity",SGRawValuePointer(&_humidity)); // Read Only prop->tie("/sim/time/sun-angle-rad",SGRawValuePointer(&_sun_angle)); @@ -225,7 +223,8 @@ void FGLight::update_sky_color () { // calculate lighting parameters based on sun's relative angle to // local up - float av = _humidity * 45; + static SGConstPropertyNode_ptr humidity = fgGetNode("/environment/relative-humidity"); + float av = humidity->getFloatValue() * 45; float visibility_log = log(av)/11.0; float visibility_inv = (45000.0 - av)/45000.0; diff --git a/src/Time/light.hxx b/src/Time/light.hxx index 6af2b3054..69987d337 100644 --- a/src/Time/light.hxx +++ b/src/Time/light.hxx @@ -98,7 +98,6 @@ private: SGVec4f _adj_sky_color; // input parameters affected by the weather system - float _humidity; float _saturation; float _scattering; -- 2.39.5