summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawable.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2021-06-07 21:04:32 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2021-06-07 21:04:32 +0300
commita4595bdaf2f24b8c08ae8c1e7a4b3dc9e9c2ef4b (patch)
tree0679478dcf2d3a77c52ec436fe5e724bf7542c85 /indra/newview/lldrawable.cpp
parentb6ac642db2213cf4207dddc47a1fe1490de0cc6e (diff)
parent4623b822386accfae5907c88099c2a88377a0271 (diff)
Merge branch 'master' into DRTVWR-521-maint
# Conflicts: # doc/contributions.txt
Diffstat (limited to 'indra/newview/lldrawable.cpp')
-rw-r--r--indra/newview/lldrawable.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 5034bd1c5e..507af56cb0 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -912,22 +912,18 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
if (volume->getAvatar())
{
const LLVector3* av_box = volume->getAvatar()->getLastAnimExtents();
- LLVector3d cam_pos = gAgent.getPosGlobalFromAgent(LLViewerCamera::getInstance()->getOrigin());
- LLVector3 cam_region_pos = LLVector3(cam_pos - volume->getRegion()->getOriginGlobal());
-
- LLVector3 cam_to_box_offset = point_to_box_offset(cam_region_pos, av_box);
+ LLVector3 cam_pos_from_agent = LLViewerCamera::getInstance()->getOrigin();
+ LLVector3 cam_to_box_offset = point_to_box_offset(cam_pos_from_agent, av_box);
mDistanceWRTCamera = llmax(0.01f, ll_round(cam_to_box_offset.magVec(), 0.01f));
LL_DEBUGS("DynamicBox") << volume->getAvatar()->getFullname()
<< " pos (ignored) " << pos
- << " cam pos " << cam_pos
- << " cam region pos " << cam_region_pos
+ << " cam pos " << cam_pos_from_agent
<< " box " << av_box[0] << "," << av_box[1]
<< " -> dist " << mDistanceWRTCamera
<< LL_ENDL;
mVObjp->updateLOD();
return;
}
-
}
else
{