From a61b6d1d1772d42e737c6b55dbfe8bfc1761c1a6 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 23 Feb 2018 14:46:40 +0000 Subject: MAINT-8264 - stuck LODs caused by uninitialized values --- indra/newview/llvovolume.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a6dad467f0..3e0041804b 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1282,11 +1282,21 @@ BOOL LLVOVolume::calcLOD() distance = avatar->mDrawable->mDistanceWRTCamera; radius = avatar->getBinRadius(); + if (distance <= 0.f || radius <= 0.f) + { + LL_DEBUGS("CalcLOD") << "avatar distance/radius uninitialized, skipping" << LL_ENDL; + return FALSE; + } } else { distance = mDrawable->mDistanceWRTCamera; radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); + if (distance <= 0.f || radius <= 0.f) + { + LL_DEBUGS("CalcLOD") << "non-avatar distance/radius uninitialized, skipping" << LL_ENDL; + return FALSE; + } } //hold onto unmodified distance for debugging @@ -1328,6 +1338,13 @@ BOOL LLVOVolume::calcLOD() if (cur_detail != mLOD) { + LL_DEBUGS("CalcLOD") << "new LOD " << cur_detail << " change from " << mLOD + << " distance " << distance << " radius " << radius << " rampDist " << rampDist + << " drawable rigged? " << (mDrawable ? (S32) mDrawable->isState(LLDrawable::RIGGED) : (S32) -1) + << " mRiggedVolume " << (void*)getRiggedVolume() + << " distanceWRTCamera " << (mDrawable ? mDrawable->mDistanceWRTCamera : -1.f) + << LL_ENDL; + mAppAngle = ll_round((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); mLOD = cur_detail; -- cgit v1.2.3