summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2016-11-08 04:44:46 +0200
committerAndreyL ProductEngine <alihatskiy@productengine.com>2016-11-08 04:44:46 +0200
commit0e6e04317bb896331b984e624c48e702986f2def (patch)
treeb347fb94ebd0ffc82d246f43d5817ebfd18e1b56 /indra/newview/llvovolume.cpp
parent1ff67ec5124b5b08e1e0d050d06773c9d3c889fc (diff)
Backed out changeset: 27782e83386b
Reverting MAINT-6793
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp38
1 files changed, 5 insertions, 33 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 8d86623665..55739915a3 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -80,14 +80,13 @@
const F32 FORCE_SIMPLE_RENDER_AREA = 512.f;
const F32 FORCE_CULL_AREA = 8.f;
-static const F32 MINIMUM_RIGGED_RADIUS = 0.05f;
U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG = 20;
BOOL gAnimateTextures = TRUE;
//extern BOOL gHideSelectedObjects;
F32 LLVOVolume::sLODFactor = 1.f;
-F32 LLVOVolume::sRiggedLODCompensation = 6.5f;
+F32 LLVOVolume::sRiggedFactorMultiplier = 6.f;
F32 LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop
F32 LLVOVolume::sDistanceFactor = 1.0f;
S32 LLVOVolume::sNumLODChanges = 0;
@@ -1255,39 +1254,12 @@ BOOL LLVOVolume::calcLOD()
}
// Note: when changing, take note that a lot of rigged meshes have only one LOD.
+ lod_factor *= LLVOVolume::sRiggedFactorMultiplier;
distance = avatar->mDrawable->mDistanceWRTCamera;
F32 avatar_radius = avatar->getBinRadius();
- F32 object_radius = 0;
-
- LLDrawable* drawablep = mDrawable.get();
- while (!drawablep->isRoot())
- {
- drawablep = drawablep->getParent();
- }
-
- // Mesh can consist of multiple objects that have to be treated as one item or we will
- // get strange deformations or partially missing meshes (smallest elements will disappear)
- LLSpatialBridge* bridge = drawablep->getSpatialBridge();
- if (bridge)
- {
- const LLVector4a* ext = bridge->getSpatialExtents();
- LLVector4a diff;
- diff.setSub(ext[1], ext[0]);
- object_radius = diff.getLength3().getF32();
- }
-
- if (object_radius <= 0)
- {
- // bridge missing or somehow not updated
- const LLVector4a* ext = mDrawable->getSpatialExtents();
- LLVector4a diff;
- diff.setSub(ext[1], ext[0]);
- object_radius = diff.getLength3().getF32();
- }
-
- // sRiggedLODCompensation is made to compensate for missing lower lods
- radius = object_radius * LLVOVolume::sRiggedLODCompensation;
- radius = llclamp(radius, MINIMUM_RIGGED_RADIUS, avatar_radius);
+ F32 object_radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length();
+ radius = object_radius * LLVOVolume::sRiggedFactorMultiplier;
+ radius = llmin(radius, avatar_radius);
}
else
{