From 8771130ef72af23a163eb3dc08782bec979f0251 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 27 Jul 2022 19:30:55 +0300 Subject: SL-17809 Sounds from Avatar position instead of Camera position --- indra/newview/llviewermedia.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 812f804ea9..03c9926e1d 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3581,7 +3581,20 @@ void LLViewerMediaImpl::calculateInterest() LLVector3d global_delta = agent_global - obj_global ; mProximityDistance = global_delta.magVecSquared(); // use distance-squared because it's cheaper and sorts the same. - LLVector3d camera_delta = gAgentCamera.getCameraPositionGlobal() - obj_global; + static LLUICachedControl mEarLocation("MediaSoundsEarLocation", 0); + LLVector3d ear_position; + switch(mEarLocation) + { + case 0: + default: + ear_position = gAgentCamera.getCameraPositionGlobal(); + break; + + case 1: + ear_position = agent_global; + break; + } + LLVector3d camera_delta = ear_position - obj_global; mProximityCamera = camera_delta.magVec(); } } -- cgit v1.2.3 From 6661e0fdc5becd17d438e0a1a5c47094598667fc Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 28 Sep 2022 17:37:33 +0300 Subject: SL-18240 Don't disable HUD media when "Obscure MOAP" is active on land --- indra/newview/llviewermedia.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 84013c488f..8570c0cd5d 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3896,7 +3896,7 @@ bool LLViewerMediaImpl::shouldShowBasedOnClass() const // bool LLViewerMediaImpl::isObscured() const { - if (getUsedInUI() || isParcelMedia()) return false; + if (getUsedInUI() || isParcelMedia() || isAttachedToHUD()) return false; LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (!agent_parcel) @@ -3912,6 +3912,20 @@ bool LLViewerMediaImpl::isObscured() const return false; } +bool LLViewerMediaImpl::isAttachedToHUD() const +{ + std::list< LLVOVolume* >::const_iterator iter = mObjectList.begin(); + std::list< LLVOVolume* >::const_iterator end = mObjectList.end(); + for ( ; iter != end; iter++) + { + if ((*iter)->isHUDAttachment()) + { + return true; + } + } + return false; +} + ////////////////////////////////////////////////////////////////////////////////////////// // bool LLViewerMediaImpl::isAttachedToAnotherAvatar() const -- cgit v1.2.3