summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-02-07 13:59:10 -0600
committerDave Parks <davep@lindenlab.com>2023-02-07 13:59:10 -0600
commitbe9e4f186db1b3612a26e27a0294114ca66c539c (patch)
tree51ea16d52eb08b0b247a954bf7495df6568add5d /indra
parent055883beb5709dfb4814c8c5e90ea326abc07724 (diff)
SL-18630 Nudge underground automatic reflection probes to 2m above ground.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llreflectionmap.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp
index f346531bfd..ce749a96c7 100644
--- a/indra/newview/llreflectionmap.cpp
+++ b/indra/newview/llreflectionmap.cpp
@@ -30,6 +30,7 @@
#include "pipeline.h"
#include "llviewerwindow.h"
#include "llviewerregion.h"
+#include "llworld.h"
extern F32SecondsImplicit gFrameTimeSeconds;
@@ -123,6 +124,12 @@ void LLReflectionMap::autoAdjustOrigin()
mOrigin.mul(0.5f);
}
+ // make sure origin isn't under ground
+ F32* fp = mOrigin.getF32ptr();
+ LLVector3 origin(fp);
+ F32 height = LLWorld::instance().resolveLandHeightAgent(origin) + 2.f;
+ fp[2] = llmax(fp[2], height);
+
// make sure radius encompasses all objects
LLSimdScalar r2 = 0.0;
for (int i = 0; i < 8; ++i)