summaryrefslogtreecommitdiff
path: root/indra/newview/llvosky.cpp
diff options
context:
space:
mode:
authorGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-05-18 23:14:56 +0100
committerGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-05-18 23:14:56 +0100
commit8082cb86682c008389cb8127f295e6566ec368e5 (patch)
treee8168fc436aa4aaf5274719c917a64fee0af0a54 /indra/newview/llvosky.cpp
parent242fe0610996696a026dc2dc9b1b42c4db2f852c (diff)
Make nighttime elev constant _SIN, since it uses a sin value.
Put that constant in sky settings and eliminate dups. Fix up logic around when to use heavenly bodies (fix broken moon in basic sky). Remove unnecessary clip to horizon. Put in temp code to ena/dis sun/moon based on LLEnvironment::getIsDaytime().
Diffstat (limited to 'indra/newview/llvosky.cpp')
-rw-r--r--indra/newview/llvosky.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 5f55f6c310..1e99c77da9 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -700,6 +700,12 @@ BOOL LLVOSky::updateGeometry(LLDrawable *drawable)
bool draw_sun = updateHeavenlyBodyGeometry(drawable, FACE_SUN, mSun, up, right);
bool draw_moon = updateHeavenlyBodyGeometry(drawable, FACE_MOON, mMoon, up, right);
+ bool daytime = LLEnvironment::getInstance()->getIsDayTime();
+
+ // makeshift check until we properly handle moon in daytime
+ draw_sun &= daytime;
+ draw_moon &= !daytime;
+
mSun.setDraw(draw_sun);
mMoon.setDraw(draw_moon);
@@ -763,16 +769,7 @@ BOOL LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, const S32 f, LLHe
S32 index_offset;
LLFace *facep;
- LLVector3 to_dir = hb.getDirection();
-
- /*F32 rad = hb.getDiskRadius();
- F32 d = to_dir * LLVector3::z_axis;
- if (d < -(rad * 0.5f))
- {
- hb.setVisible(FALSE);
- return FALSE;
- }*/
-
+ LLVector3 to_dir = hb.getDirection();
LLVector3 draw_pos = to_dir * HEAVENLY_BODY_DIST;
LLVector3 hb_right = to_dir % LLVector3::z_axis;
@@ -780,8 +777,12 @@ BOOL LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, const S32 f, LLHe
hb_right.normalize();
hb_up.normalize();
- const LLVector3 scaled_right = HEAVENLY_BODY_DIST * hb.getDiskRadius() * hb_right;
- const LLVector3 scaled_up = HEAVENLY_BODY_DIST * hb.getDiskRadius() * hb_up;
+ const F32 enlargm_factor = ( 1 - to_dir.mV[2] );
+ F32 horiz_enlargement = 1 + enlargm_factor * 0.3f;
+ F32 vert_enlargement = 1 + enlargm_factor * 0.2f;
+
+ const LLVector3 scaled_right = horiz_enlargement * HEAVENLY_BODY_DIST * HEAVENLY_BODY_FACTOR * hb.getDiskRadius() * hb_right;
+ const LLVector3 scaled_up = vert_enlargement * HEAVENLY_BODY_DIST * HEAVENLY_BODY_FACTOR * hb.getDiskRadius() * hb_up;
LLVector3 v_clipped[4];