summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawable.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-12-14 19:20:22 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-01-06 22:52:18 +0200
commit5af5498cf60b98c6ca00a1341ec4099b6cf0ffe9 (patch)
treeacb520a0f4cf69e5681b1a22d8e0b9f4f5c0956e /indra/newview/lldrawable.cpp
parent1a8800b051166d3406065df312c66b7e4f00fe05 (diff)
SL-11300 Camera distance to avatar in neighbouring region incorrect
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 2219f20272..1da94f4698 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
{