summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-02-23 14:46:40 +0000
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-02-23 14:46:40 +0000
commita61b6d1d1772d42e737c6b55dbfe8bfc1761c1a6 (patch)
tree9d783ebc4373769eb37d6e555db08381eeab1f20
parentad72a52edd4a528b04fa3a65c8942aa6fb4edcde (diff)
MAINT-8264 - stuck LODs caused by uninitialized values
-rw-r--r--indra/newview/llvovolume.cpp17
1 files changed, 17 insertions, 0 deletions
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;