Fixed geom never generating in some scenarios.

This commit is contained in:
Shyotl
2019-04-17 00:11:25 -05:00
parent bee0109e33
commit 7f776c0d53
2 changed files with 12 additions and 8 deletions

View File

@@ -868,7 +868,7 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
{ {
LL_DEBUGS("RiggedBox") << "skipping face " << f << ", bad num vertices " LL_DEBUGS("RiggedBox") << "skipping face " << f << ", bad num vertices "
<< face.mNumVertices << " " << face.mNumIndices << " " << face.mWeights << LL_ENDL; << face.mNumVertices << " " << face.mNumIndices << " " << face.mWeights << LL_ENDL;
return FALSE; return FALSE;
} }
//VECTORIZE THIS //VECTORIZE THIS

View File

@@ -1331,9 +1331,7 @@ BOOL LLVOVolume::calcLOD()
if (distance < rampDist) if (distance < rampDist)
{ {
// Boost LOD when you're REALLY close // Boost LOD when you're REALLY close
distance *= 1.0f/rampDist; distance *= distance/rampDist;
distance *= distance;
distance *= rampDist;
} }
// DON'T Compensate for field of view changing on FOV zoom. // DON'T Compensate for field of view changing on FOV zoom.
@@ -1435,7 +1433,8 @@ BOOL LLVOVolume::setDrawableParent(LLDrawable* parentp)
void LLVOVolume::updateFaceFlags() void LLVOVolume::updateFaceFlags()
{ {
for (S32 i = 0; i < getVolume()->getNumFaces(); i++) // There's no guarantee that getVolume()->getNumFaces() == mDrawable->getNumFaces()
for (S32 i = 0; i < getVolume()->getNumFaces() && i < mDrawable->getNumFaces(); i++)
{ {
LLFace *face = mDrawable->getFace(i); LLFace *face = mDrawable->getFace(i);
if (face) if (face)
@@ -1572,19 +1571,24 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global)
} }
} }
if (!any_valid_boxes) { if (!any_valid_boxes) {
for (S32 i = 0; i < getVolume()->getNumVolumeFaces(); i++) // There's no guarantee that getVolume()->getNumFaces() == mDrawable->getNumFaces()
for (S32 i = 0;
i < getVolume()->getNumVolumeFaces() && i < mDrawable->getNumFaces() && i < getNumTEs();
i++)
{ {
LLFace *face = mDrawable->getFace(i); LLFace *face = mDrawable->getFace(i);
if (!face) if (!face)
{ {
continue; continue;
} }
res &= face->genVolumeBBoxes(*volume, i, bool face_res = face->genVolumeBBoxes(*volume, i,
mRelativeXform, mRelativeXform,
(mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global); (mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global);
// Singu note: Don't let one bad face to ruin the whole volume. &= bad. |= good.
res &= face_res;
// MAINT-8264 - ignore bboxes of ill-formed faces. // MAINT-8264 - ignore bboxes of ill-formed faces.
if (!res) if (!face_res)
{ {
continue; continue;
} }