From ea3e0c7dd66efa48210b3e067245a7c4e7e6e5cb Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 18 Apr 2015 01:43:26 +0200 Subject: [PATCH] newMin/newMax had never been properly clamped. --- indra/newview/llvocache.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index fd1d57a9d0..9a26243221 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -591,11 +591,20 @@ void LLVOCacheEntry::updateParentBoundingInfo(const LLVOCacheEntry* child) const LLVector4a* parent_exts = getSpatialExtents(); update_min_max(newMin, newMax, parent_exts[0]); update_min_max(newMin, newMax, parent_exts[1]); - for(S32 i = 0; i < 4; i++) - { - llclamp(newMin[i], 0.f, 256.f); - llclamp(newMax[i], 0.f, 256.f); - } + + // Either the next to lines are useless, or there was an assignment missing. + + // for(S32 i = 0; i < 4; i++) + // { + // llclamp(newMin[i], 0.f, 256.f); + // llclamp(newMax[i], 0.f, 256.f); + // } + + newMin.clamp( LLVector4a( 0.f ), LLVector4a( 256.f ) ); + newMax.clamp( LLVector4a( 0.f ), LLVector4a( 256.f ) ); + + // + setSpatialExtents(newMin, newMax); //update parent's bbox center