summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-02-26 15:37:20 +0000
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-02-26 15:37:20 +0000
commit28b95e4975f2333c0eb590b29740c3ce491a934d (patch)
treeb5c2d20678914db3dfd1b26859a9b55a520a479e /indra/newview
parent5af9ce5737903aa730db47733fbb0e164d87eaf4 (diff)
MAINT-8264 - more LODs
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llvovolume.cpp46
1 files changed, 28 insertions, 18 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 3e0041804b..e1b603f86e 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1539,6 +1539,8 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global)
volume = getVolume();
}
+ bool any_valid_boxes = false;
+
if (getRiggedVolume())
{
LL_DEBUGS("RiggedBox") << "rebuilding box, volume face count " << getVolume()->getNumVolumeFaces() << " drawable face count " << mDrawable->getNumFaces() << LL_ENDL;
@@ -1559,44 +1561,52 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global)
(mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global);
res &= face_res; // note that this result is never used
+ // MAINT-8264 - ignore bboxes of ill-formed faces.
+ if (!face_res)
+ {
+ continue;
+ }
if (rebuild)
{
if (getRiggedVolume())
{
LL_DEBUGS("RiggedBox") << "rebuilding box, face " << i << " extents " << face->mExtents[0] << ", " << face->mExtents[1] << LL_ENDL;
}
- if (i == 0)
+ if (!any_valid_boxes)
{
min = face->mExtents[0];
max = face->mExtents[1];
+ any_valid_boxes = true;
}
else
{
- if (!face_res)
- {
- // MAINT-8264 - ignore bboxes of ill-formed faces.
- continue;
- }
min.setMin(min, face->mExtents[0]);
max.setMax(max, face->mExtents[1]);
}
}
}
-
- if (rebuild)
- {
- if (getRiggedVolume())
+
+ if (any_valid_boxes)
+ {
+ if (rebuild)
{
- LL_DEBUGS("RiggedBox") << "rebuilding got extents " << min << ", " << max << LL_ENDL;
+ if (getRiggedVolume())
+ {
+ LL_DEBUGS("RiggedBox") << "rebuilding got extents " << min << ", " << max << LL_ENDL;
+ }
+ mDrawable->setSpatialExtents(min,max);
+ min.add(max);
+ min.mul(0.5f);
+ mDrawable->setPositionGroup(min);
}
- mDrawable->setSpatialExtents(min,max);
- min.add(max);
- min.mul(0.5f);
- mDrawable->setPositionGroup(min);
- }
- updateRadius();
- mDrawable->movePartition();
+ updateRadius();
+ mDrawable->movePartition();
+ }
+ else
+ {
+ LL_DEBUGS("RiggedBox") << "genBBoxes failed to find any valid face boxes" << LL_ENDL;
+ }
return res;
}