From ae5f24eb4d8a215cc26ef45ababc6ddec8f28edb Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Mon, 21 May 2018 19:10:32 +0100 Subject: Make rendering of sun / moon work with both in the sky (test visibility independently). --- indra/newview/llenvironment.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/newview/llenvironment.cpp') diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index d37cbfc76d..cc3a30d0b1 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -377,9 +377,16 @@ F32 LLEnvironment::getWaterHeight() const return gAgent.getRegion()->getWaterHeight(); } -bool LLEnvironment::getIsDayTime() const +bool LLEnvironment::getIsSunUp() const { - return mCurrentEnvironment->getSky()->getSunDirection().mV[2] > NIGHTTIME_ELEVATION_SIN; + LLVector3 sunDir = mCurrentEnvironment->getSky()->getSunDirection(); + return sunDir.mV[2] > NIGHTTIME_ELEVATION_SIN; +} + +bool LLEnvironment::getIsMoonUp() const +{ + LLVector3 moonDir = mCurrentEnvironment->getSky()->getMoonDirection(); + return moonDir.mV[2] > NIGHTTIME_ELEVATION_SIN; } //------------------------------------------------------------------------- -- cgit v1.2.3