From cc2e0caa5f26baf29ce6cccb120ea95621cfe038 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Thu, 14 Mar 2013 13:22:23 -0500
Subject: [PATCH] Fix for broken LoD.

Reviewed by Graham.
---
 indra/newview/lldrawable.cpp | 2 +-
 indra/newview/llvovolume.cpp | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index dc0e256ebbb..235da419984 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -767,7 +767,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
 		}
 
 		pos -= camera.getOrigin();	
-		mDistanceWRTCamera = 20.0f;//llround(pos.magVec(), 0.01f);
+		mDistanceWRTCamera = llround(pos.magVec(), 0.01f);
 		mVObjp->updateLOD();
 	}
 }
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 3ce32b40bbb..9dcdd467e7b 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1299,9 +1299,9 @@ BOOL LLVOVolume::calcLOD()
 	if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) &&
 		mDrawable->getFace(0))
 	{
-		//setDebugText(llformat("%.2f:%.2f, %d", debug_distance, radius, cur_detail));
+		setDebugText(llformat("%.2f:%.2f, %d", mDrawable->mDistanceWRTCamera, radius, cur_detail));
 
-		setDebugText(llformat("%d", mDrawable->getFace(0)->getTextureIndex()));
+		//setDebugText(llformat("%d", mDrawable->getFace(0)->getTextureIndex()));
 	}
 
 	if (cur_detail != mLOD)
@@ -2993,7 +2993,7 @@ void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_p
 
 		//transform view vector into volume space
 		view_vector -= getRenderPosition();
-		mDrawable->mDistanceWRTCamera = view_vector.length();
+		//mDrawable->mDistanceWRTCamera = view_vector.length();
 		LLQuaternion worldRot = getRenderRotation();
 		view_vector = view_vector * ~worldRot;
 		if (!isVolumeGlobal())
-- 
GitLab