summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawable.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-09-19 15:53:44 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-09-19 15:53:44 +0100
commit301821337bf692d9f8d56230dc620efa74fcd275 (patch)
tree4fd0a73f691033ae91a12c4500d924a1375571b6 /indra/newview/lldrawable.cpp
parent02b7a9a0fa0f6e1b9a9695f7cc80ceb10b1d8071 (diff)
SL-9680, SL-9673 - set attachment distance floor at 0.01 to avoid triggering divide-by-zero prevention logic. Force HUD attachments to always be full detail.
Diffstat (limited to 'indra/newview/lldrawable.cpp')
-rw-r--r--indra/newview/lldrawable.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 6f48b8a968..55db721ccf 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -913,12 +913,14 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
LLVector3 cam_region_pos = LLVector3(cam_pos - volume->getRegion()->getOriginGlobal());
LLVector3 cam_to_box_offset = point_to_box_offset(cam_region_pos, av_box);
- //LL_DEBUGS("DynamicBox") << volume->getAvatar()->getFullname()
- // << " pos (ignored) " << pos
- // << " cam pos " << cam_pos
- // << " cam region pos " << cam_region_pos
- // << " box " << av_box[0] << "," << av_box[1] << LL_ENDL;
- mDistanceWRTCamera = ll_round(cam_to_box_offset.magVec(), 0.01f);
+ 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
+ << " box " << av_box[0] << "," << av_box[1]
+ << " -> dist " << mDistanceWRTCamera
+ << LL_ENDL;
mVObjp->updateLOD();
return;
}