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/app_settings/settings.xml | 11 + indra/newview/llvieweraudio.cpp | 15 +- indra/newview/llviewermedia.cpp | 15 +- .../default/xui/en/panel_preferences_sound.xml | 275 +++++++++++---------- 4 files changed, 180 insertions(+), 136 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 16d8cd9f06..b156e96d1f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14620,6 +14620,17 @@ Value 0 + MediaSoundsEarLocation + + Comment + Location of the virtual ear for media and sounds + Persist + 1 + Type + S32 + Value + 0 + VoiceHost Comment diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index f810e5f4ef..cc73f7ca80 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -496,7 +496,20 @@ void audio_update_listener() if (gAudiop) { // update listener position because agent has moved - LLVector3d lpos_global = gAgentCamera.getCameraPositionGlobal(); + static LLUICachedControl mEarLocation("MediaSoundsEarLocation", 0); + LLVector3d ear_position; + switch(mEarLocation) + { + case 0: + default: + ear_position = gAgentCamera.getCameraPositionGlobal(); + break; + + case 1: + ear_position = gAgent.getPositionGlobal(); + break; + } + LLVector3d lpos_global = ear_position; LLVector3 lpos_global_f; lpos_global_f.setVec(lpos_global); 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(); } } diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml index 42a34d171a..ab2e9c72f3 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml @@ -322,154 +322,161 @@ name="enable_voice_check" width="110"/> - - Media auto-play - - + Hear media and sounds from: + + + + + + + + Auto-play media + + - - - - - - - - Voice Chat Settings - - - Listen from: - - - - - - - + width="115"> + + + + + + Hear voice from: + + + + + - + + -- cgit v1.2.3