summaryrefslogtreecommitdiff
path: root/indra/newview/llface.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2012-07-30 14:57:33 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2012-07-30 14:57:33 -0400
commita5c9d89b28d74c1996a0c950a0c8b1484b43d243 (patch)
treeafd2dc64d86c69390fe2f482870fae0b097b768a /indra/newview/llface.cpp
parent0f3c5e6458acdf1676f0b7a6dc42ed8cfa286cb0 (diff)
parentd306cb059b9b56c1eb051074e19796b47e1c262d (diff)
merge
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r--indra/newview/llface.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 373b1930f5..2060d13ca8 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -2169,6 +2169,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;
@@ -2234,8 +2240,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