diff options
author | Graham Linden <graham@lindenlab.com> | 2019-02-05 11:13:09 -0800 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-02-05 11:13:09 -0800 |
commit | e17756e700a47bdb1857551268ee385533c9feca (patch) | |
tree | dd19295e89373c7ebcd0738771cc94da8bdcd823 /indra/newview | |
parent | 910de3048957411a8e69b09c6f98909cbf4b57fc (diff) |
SL-10443
Make fix which gets 10276 and 10443, but leaves the bizarre flip at the zenith
so that the sun/moon textures are always upright w.r.t the viewer.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llvosky.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 678f1fe748..96363045d3 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -1212,10 +1212,19 @@ bool LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, F32 scale, const S32 index_offset; LLFace *facep; + LLQuaternion rot = hb.getRotation(); - LLVector3 to_dir = LLVector3::x_axis * rot; - LLVector3 hb_right = LLVector3::y_axis_neg * rot; - LLVector3 hb_up = LLVector3::z_axis * rot; + LLVector3 to_dir = LLVector3::x_axis * rot; + + LLVector3 hb_right = to_dir % LLVector3::z_axis; + LLVector3 hb_up = hb_right % to_dir; + + // at zenith so math below fails spectacularly + if ((to_dir * LLVector3::z_axis) > 0.99f) + { + hb_right = LLVector3::y_axis_neg * rot; + hb_up = LLVector3::z_axis * rot; + } LLVector3 draw_pos = to_dir * HEAVENLY_BODY_DIST; |