diff --git a/src/Environment/ephemeris.cxx b/src/Environment/ephemeris.cxx index 0c3bfabbe..cd17fae6d 100644 --- a/src/Environment/ephemeris.cxx +++ b/src/Environment/ephemeris.cxx @@ -72,10 +72,11 @@ void Ephemeris::init() tieMoonPos("/ephemeris/moon/lat-deg", _impl->get_moon(), &MoonPos::getLat); tieMoonPos("/ephemeris/moon/age", _impl->get_moon(), &MoonPos::getAge); tieMoonPos("/ephemeris/moon/phase", _impl->get_moon(), &MoonPos::getPhase); - tieMoonPos("/environment/moonlight", _impl->get_moon(), &MoonPos::getIlluminanceFactor); _latProp = fgGetNode("/position/latitude-deg", true); + _moonlight = fgGetNode("/environment/moonlight", true); + update(0.0); } @@ -102,4 +103,7 @@ void Ephemeris::update(double) { SGTime* st = globals->get_time_params(); _impl->update(st->getMjd(), st->getLst(), _latProp->getDoubleValue()); + + // Update the moonlight intensity. + _moonlight->setDoubleValue(_impl->get_moon()->getIlluminanceFactor()); } diff --git a/src/Environment/ephemeris.hxx b/src/Environment/ephemeris.hxx index 82d67521a..698b3165c 100644 --- a/src/Environment/ephemeris.hxx +++ b/src/Environment/ephemeris.hxx @@ -51,6 +51,7 @@ public: private: SGEphemeris* _impl; SGPropertyNode* _latProp; + SGPropertyNode* _moonlight; }; #endif // of FG_ENVIRONMENT_EPHEMERIS_HXX