diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-04-10 03:55:09 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-04-10 03:55:09 +0300 |
commit | 8fa956a16e616191e21bf001eabc4670453debcd (patch) | |
tree | aecadf995f0174cc41f7cb9846a1382a930d8f82 /indra/newview/llhudnametag.cpp | |
parent | 37392be4171303db08a4842b7882b4cb758a8f8d (diff) | |
parent | da9a1dcb55548a249ff7a1255f3e518696b81245 (diff) |
Merge branch 'main' into marchcat/b-merge
# Conflicts:
# indra/llrender/llgl.cpp
# indra/newview/lloutfitslist.cpp
Diffstat (limited to 'indra/newview/llhudnametag.cpp')
-rw-r--r-- | indra/newview/llhudnametag.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index 26fc899eb5..5524bb7f09 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -897,6 +897,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<LLViewerObject*> &pick_list) { |