diff options
author | Oz Linden <oz@lindenlab.com> | 2016-03-16 13:08:06 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2016-03-16 13:08:06 -0400 |
commit | 31f3db02919870a8e92c9452de477c1478b273e9 (patch) | |
tree | 1acf6944bf8dbe0b67bb64caee9188ad5e36d913 /indra/newview/llhudtext.cpp | |
parent | 0b996159cef3a4022c6a3d4691bd2e2db37b6e92 (diff) | |
parent | 9197a8652e49178c63ea208c6c4acf1ca3433659 (diff) |
merge changes for DRTVWR-417
Diffstat (limited to 'indra/newview/llhudtext.cpp')
-rw-r--r-- | indra/newview/llhudtext.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 2c204170f2..52e83fe412 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -53,6 +53,7 @@ const F32 VERTICAL_PADDING = 12.f; const F32 BUFFER_SIZE = 2.f; const F32 HUD_TEXT_MAX_WIDTH = 190.f; const F32 HUD_TEXT_MAX_WIDTH_NO_BUBBLE = 1000.f; +const F32 MAX_DRAW_DISTANCE = 64.f; std::set<LLPointer<LLHUDText> > LLHUDText::sTextObjects; std::vector<LLPointer<LLHUDText> > LLHUDText::sVisibleTextObjects; @@ -373,7 +374,7 @@ void LLHUDText::updateVisibility() mVisible = FALSE; return; } - + if (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis() <= LLViewerCamera::getInstance()->getNear() + 0.1f + mSourceObject->getVObjRadius()) { mPositionAgent = LLViewerCamera::getInstance()->getOrigin() + vec_from_camera * ((LLViewerCamera::getInstance()->getNear() + 0.1f) / (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis())); @@ -391,6 +392,15 @@ void LLHUDText::updateVisibility() return; } + LLVector3 pos_agent_center = gAgent.getPosAgentFromGlobal(mPositionGlobal) - dir_from_camera; + F32 last_distance_center = (pos_agent_center - LLViewerCamera::getInstance()->getOrigin()).magVec(); + if(last_distance_center > MAX_DRAW_DISTANCE) + { + mVisible = FALSE; + return; + } + + LLVector3 x_pixel_vec; LLVector3 y_pixel_vec; |