diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2016-12-21 18:08:59 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2016-12-21 18:08:59 +0200 |
commit | c496269f59128128e02ebe82251f09ab169788fe (patch) | |
tree | 8c19864c0e4940f41728ce714836220780cba62f /indra/newview | |
parent | 18c463981215f60382293aa792b38ceb79cc7b76 (diff) | |
parent | 07a201094a1483974638d21efc697661629cbe95 (diff) |
Merged in MAINT-3609
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llwlanimator.cpp | 21 |
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; |