From 2a87b64d26fba502e6b8514084d91b1f79965fd1 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Thu, 3 Aug 2023 16:01:45 +0200 Subject: SL-19887 Water cuts avatar's name bubble --- indra/newview/llhudnametag.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llhudnametag.cpp') diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index ab6a64157c..a45246eedc 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -898,6 +898,15 @@ void LLHUDNameTag::shift(const LLVector3& offset) mPositionAgent += offset; } +F32 LLHUDNameTag::getWorldHeight() const +{ + const LLViewerCamera* camera = LLViewerCamera::getInstance(); + F32 height_meters = mLastDistance * (F32)tan(camera->getView() / 2.f); + F32 height_pixels = camera->getViewHeightInPixels() / 2.f; + F32 meters_per_pixel = height_meters / height_pixels; + return mHeight * meters_per_pixel * gViewerWindow->getDisplayScale().mV[VY]; +} + //static void LLHUDNameTag::addPickable(std::set &pick_list) { -- cgit v1.3