summaryrefslogtreecommitdiff
path: root/indra/newview/llreflectionmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llreflectionmap.cpp')
-rw-r--r--indra/newview/llreflectionmap.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp
index efaf068bd2..ec54fa1165 100644
--- a/indra/newview/llreflectionmap.cpp
+++ b/indra/newview/llreflectionmap.cpp
@@ -117,7 +117,7 @@ void LLReflectionMap::autoAdjustOrigin()
{
int face = -1;
LLVector4a intersection;
- LLDrawable* drawable = mGroup->lineSegmentIntersect(bounds[0], corners[i], false, false, true, &face, &intersection);
+ LLDrawable* drawable = mGroup->lineSegmentIntersect(bounds[0], corners[i], false, false, true, true, &face, &intersection);
if (drawable != nullptr)
{
hit = true;
@@ -157,6 +157,10 @@ void LLReflectionMap::autoAdjustOrigin()
}
mRadius = llmax(sqrtf(r2.getF32()), 8.f);
+
+ // make sure near clip doesn't poke through ground
+ fp[2] = llmax(fp[2], height+mRadius*0.5f);
+
}
}
else if (mViewerObject)
@@ -204,6 +208,14 @@ F32 LLReflectionMap::getNearClip()
{
ret = ((LLVOVolume*)mViewerObject)->getReflectionProbeNearClip();
}
+ else if (mGroup)
+ {
+ ret = mRadius * 0.5f; // default to half radius for automatic object probes
+ }
+ else
+ {
+ ret = 1.f; // default to 1m for automatic terrain probes
+ }
return llmax(ret, MINIMUM_NEAR_CLIP);
}