diff options
author | Dave Parks <davep@lindenlab.com> | 2011-06-09 17:04:08 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-06-09 17:04:08 -0500 |
commit | f14fc028af5f75601eaaedf5ed3923a9d039bad7 (patch) | |
tree | 04dfcfc805e143562a7328300ec0c48b8dafa234 /indra/llmath | |
parent | 37a3b0d75392836034955a9d00ac1d8a6db20473 (diff) | |
parent | 91fe50ecc7f6e2c38286a456f2cb795fbcc92dd8 (diff) |
merge
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/llvolume.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 379ef4b344..8c81f27784 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2642,14 +2642,20 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) LLVector4a& min = face.mExtents[0]; LLVector4a& max = face.mExtents[1]; - min.clear(); - max.clear(); - min = max = face.mPositions[0]; - - for (S32 i = 1; i < face.mNumVertices; ++i) + if (face.mNumVertices < 3) + { //empty face, use a dummy 1cm (at 1m scale) bounding box + min.splat(-0.005f); + max.splat(0.005f); + } + else { - min.setMin(min, face.mPositions[i]); - max.setMax(max, face.mPositions[i]); + min = max = face.mPositions[0]; + + for (S32 i = 1; i < face.mNumVertices; ++i) + { + min.setMin(min, face.mPositions[i]); + max.setMax(max, face.mPositions[i]); + } } } } @@ -5506,6 +5512,8 @@ LLVolumeFace::LLVolumeFace() : mOctree(NULL) { mExtents = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*3); + mExtents[0].splat(-0.5f); + mExtents[1].splat(0.5f); mCenter = mExtents+2; } |