summaryrefslogtreecommitdiff
path: root/indra/newview/llenvironment.cpp
diff options
context:
space:
mode:
authorGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-05-21 19:10:32 +0100
committerGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-05-21 19:10:32 +0100
commitae5f24eb4d8a215cc26ef45ababc6ddec8f28edb (patch)
tree9e64b5e79ad3cc503de5a766b863eeb07ed159ea /indra/newview/llenvironment.cpp
parent589e23884f957e00328b7aa04629f47d1f070a4e (diff)
Make rendering of sun / moon work with both in the sky (test visibility independently).
Diffstat (limited to 'indra/newview/llenvironment.cpp')
-rw-r--r--indra/newview/llenvironment.cpp11
1 files changed, 9 insertions, 2 deletions
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;
}
//-------------------------------------------------------------------------