summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2016-08-02 21:28:26 +0300
committerandreykproductengine <akleshchev@productengine.com>2016-08-02 21:28:26 +0300
commit22238182c67b3d322e82bb042ad1d618c733a36d (patch)
tree3a628a7ec084915ba7e222df5d44c586236d50b8
parent22e69897db61a62794116eb81e8b413ac180b8e7 (diff)
MAINT-6259 Rigged mesh LOD swapping
-rw-r--r--indra/newview/app_settings/settings.xml2
-rw-r--r--indra/newview/llvovolume.cpp13
2 files changed, 13 insertions, 2 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c3d7d67c86..f1d0901a81 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -10227,7 +10227,7 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
- <real>7.5</real>
+ <real>6.5</real>
</map>
<key>RenderWater</key>
<map>
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 5fc571bf1d..1112b7dee6 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1257,7 +1257,18 @@ BOOL LLVOVolume::calcLOD()
lod_factor *= LLVOVolume::sRiggedFactorMultiplier;
distance = avatar->mDrawable->mDistanceWRTCamera;
F32 avatar_radius = avatar->getBinRadius();
- F32 object_radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length();
+ F32 object_radius;
+ if (mDrawable.notNull() && !mDrawable->isDead())
+ {
+ const LLVector4a* ext = mDrawable->getSpatialExtents();
+ LLVector4a diff;
+ diff.setSub(ext[1], ext[0]);
+ object_radius = diff.getLength3().getF32();
+ }
+ else
+ {
+ object_radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length();
+ }
radius = object_radius * LLVOVolume::sRiggedFactorMultiplier;
radius = llmin(radius, avatar_radius);
}