summaryrefslogtreecommitdiff
path: root/indra/newview/llface.cpp
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-11-06 12:22:06 -0800
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-11-06 12:22:06 -0800
commita91c2d889aad577fb22dc8f11e0dd168d71ec09d (patch)
tree6f8234a6fcac9457c685495c2bdca6bf60a8f2df /indra/newview/llface.cpp
parentf2524568ea1895df58b7735fe959c772d558160d (diff)
parentbf6d1670756ba96abde570e7dbbf94c62c71ca5b (diff)
Pull and merge from https://bitbucket.org/lindenlab/viewer-development.
Diffstat (limited to 'indra/newview/llface.cpp')
-rwxr-xr-xindra/newview/llface.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 582f06eeb0..188f943f13 100755
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -2168,6 +2168,12 @@ BOOL LLFace::hasMedia() const
const F32 LEAST_IMPORTANCE = 0.05f ;
const F32 LEAST_IMPORTANCE_FOR_LARGE_IMAGE = 0.3f ;
+void LLFace::resetVirtualSize()
+{
+ setVirtualSize(0.f);
+ mImportanceToCamera = 0.f;
+}
+
F32 LLFace::getTextureVirtualSize()
{
F32 radius;
@@ -2233,8 +2239,17 @@ BOOL LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius)
LLVector4a t;
t.load3(camera->getOrigin().mV);
lookAt.setSub(center, t);
+
F32 dist = lookAt.getLength3().getF32();
- dist = llmax(dist-size.getLength3().getF32(), 0.f);
+ dist = llmax(dist-size.getLength3().getF32(), 0.001f);
+ //ramp down distance for nearby objects
+ if (dist < 16.f)
+ {
+ dist /= 16.f;
+ dist *= dist;
+ dist *= 16.f;
+ }
+
lookAt.normalize3fast() ;
//get area of circle around node