summaryrefslogtreecommitdiff
path: root/indra/newview/llwlanimator.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2017-03-06 14:42:48 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2017-03-06 14:42:48 -0500
commit015463c7313f93b178c517519d71889ab897361a (patch)
tree26dab56ffa84f78bfeca57e7166ff96e565572d3 /indra/newview/llwlanimator.cpp
parent09a6daabd2c4281b071f9213906872ea8a744956 (diff)
parent08ed7f676f2ce38937a03c2a4e823e3564981264 (diff)
merge
Diffstat (limited to 'indra/newview/llwlanimator.cpp')
-rw-r--r--indra/newview/llwlanimator.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/indra/newview/llwlanimator.cpp b/indra/newview/llwlanimator.cpp
index 2142885767..c8879e73eb 100644
--- a/indra/newview/llwlanimator.cpp
+++ b/indra/newview/llwlanimator.cpp
@@ -155,17 +155,28 @@ F64 LLWLAnimator::getDayTime()
// we're not solving the non-linear equation that determines sun phase
// we're just linearly interpolating between the major points
- if (phase <= 5.0 / 4.0) {
+
+ if (phase <= 5.0 / 4.0)
+ {
+ // mDayTime from 0.33 to 0.75 (6:00 to 21:00)
mDayTime = (1.0 / 3.0) * phase + (1.0 / 3.0);
}
+ else if (phase > 7.0 / 4.0)
+ {
+ // maximum value for phase is 2
+ // mDayTime from 0.25 to 0.33 (3:00 to 6:00)
+ mDayTime = (1.0 / 3.0) - (1.0 / 3.0) * (2 - phase);
+ }
else
{
+ // phase == 3/2 is where day restarts (24:00)
+ // mDayTime from 0.75 to 0.999 and 0 to 0.25 (21:00 to 03:00)
mDayTime = phase - (1.0 / 2.0);
- }
- if(mDayTime > 1)
- {
- mDayTime--;
+ if(mDayTime > 1)
+ {
+ mDayTime--;
+ }
}
return mDayTime;