diff options
| author | Graham Linden <graham@lindenlab.com> | 2019-01-24 14:54:11 -0800 |
|---|---|---|
| committer | Graham Linden <graham@lindenlab.com> | 2019-01-24 14:54:11 -0800 |
| commit | 966dc7fc8fb1fade861e8070e9c5fbbfe4d0cb45 (patch) | |
| tree | a1cbc6e22bf8e443a32aab1cd78e0fc6049e3674 /indra/newview/llvosky.cpp | |
| parent | a6f92d8190e8771d6a3372eb456dbb97c7ca0c8d (diff) | |
SL-10276
SL-9851
Fix cloud shaders to ignore clouds when cloud_scale is 0.
Fix creation of heavenly body geo to avoid degenerate vector math
and not randomly flip orientation when crossing zenith.
Add sun_up_factor to eliminate sun glow around moon when sun is down.
Diffstat (limited to 'indra/newview/llvosky.cpp')
| -rw-r--r-- | indra/newview/llvosky.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index af078251b3..7b5a922bbd 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -243,6 +243,16 @@ LLHeavenBody::LLHeavenBody(const F32 rad) mColorCached.setToBlack(); } +const LLQuaternion& LLHeavenBody::getRotation() const +{ + return mRotation; +} + +void LLHeavenBody::setRotation(const LLQuaternion& rot) +{ + mRotation = rot; +} + const LLVector3& LLHeavenBody::getDirection() const { return mDirection; @@ -738,6 +748,9 @@ void LLVOSky::updateDirections(void) mSun.setDirection(psky->getSunDirection()); mMoon.setDirection(psky->getMoonDirection()); + mSun.setRotation(psky->getSunRotation()); + mMoon.setRotation(psky->getMoonRotation()); + mSun.setColor(psky->getSunlightColor()); mMoon.setColor(psky->getMoonDiffuse()); @@ -1199,11 +1212,13 @@ bool LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, F32 scale, const S32 index_offset; LLFace *facep; - LLVector3 to_dir = hb.getDirection(); + LLQuaternion rot = hb.getRotation(); + LLVector3 to_dir = LLVector3::x_axis * rot; + LLVector3 hb_right = LLVector3::y_axis * rot; + LLVector3 hb_up = LLVector3::z_axis * rot; + LLVector3 draw_pos = to_dir * HEAVENLY_BODY_DIST; - LLVector3 hb_right = to_dir % LLVector3::z_axis; - LLVector3 hb_up = hb_right % to_dir; hb_right.normalize(); hb_up.normalize(); |
