summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-08-29 18:15:38 -0600
committerXiaohong Bao <bao@lindenlab.com>2011-08-29 18:15:38 -0600
commit8cef480b96dc779c5879f74224fb0a185ee550f2 (patch)
tree1eaae0ef23027ca1d4eecfe2410e0906be75880a
parentf054d44f9e2e0d152b1a0167b007eb10105487d6 (diff)
fix for SH-2311: crash at LLVOVolume::lineSegmentIntersect line 3435
and SH-2358: Crash in LLError::crashAndLoop: Invalid face index
-rwxr-xr-xindra/llmath/llvolume.cpp2
-rwxr-xr-xindra/newview/llvovolume.cpp7
2 files changed, 7 insertions, 2 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index b2fe9ba6c2..1a95f9cd46 100755
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2734,7 +2734,7 @@ void LLVolume::cacheOptimize()
S32 LLVolume::getNumFaces() const
{
- return (S32)mProfilep->mFaces.size();
+ return mIsMeshAssetLoaded ? getNumVolumeFaces() : (S32)mProfilep->mFaces.size();
}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index d3ef1771c3..6b0a5d8642 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1660,11 +1660,16 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
compiled = TRUE;
sNumLODChanges += new_num_faces ;
+ if((S32)getNumTEs() != getVolume()->getNumFaces())
+ {
+ setNumTEs(getVolume()->getNumFaces()); //mesh loading may change number of faces.
+ }
+
drawable->setState(LLDrawable::REBUILD_VOLUME); // for face->genVolumeTriangles()
{
LLFastTimer t(FTM_GEN_TRIANGLES);
- if (new_num_faces != old_num_faces)
+ if (new_num_faces != old_num_faces || mNumFaces != (S32)getNumTEs())
{
regenFaces();
}