From 7c7b402920c1660820e1cefa9cdd2c8154b5e990 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 22 Mar 2019 01:02:36 +0100 Subject: [PATCH 1/7] FMOD Ex is still a valid option --- indra/newview/viewer_manifest.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 89dbb313f2..43b61eabb5 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1500,17 +1500,17 @@ class DarwinManifest(ViewerManifest): dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) # dylibs that vary based on configuration - # if self.args['configuration'].lower() == 'debug': - # for libfile in ( - # "libfmodexL.dylib", - # ): - # dylibs += path_optional(os.path.join(debpkgdir, libfile), libfile) - # else: - # for libfile in ( - # "libfmodex.dylib", - # ): - # dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) - + if self.args['configuration'].lower() == 'debug': + for libfile in ( + "libfmodexL.dylib", + ): + dylibs += path_optional(os.path.join(debpkgdir, libfile), libfile) + else: + for libfile in ( + "libfmodex.dylib", + ): + dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) + # our apps executable_path = {} for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"), From ef44648b43a87912b141cb9d780cc05e2582e049 Mon Sep 17 00:00:00 2001 From: Nicky Date: Fri, 22 Mar 2019 15:31:31 +0100 Subject: [PATCH 2/7] Update Duallahan for Linux x64. --- autobuild.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 878ec294fd..7b083ff84c 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -52,9 +52,9 @@ archive hash - 3156400f22047d6e194884970842f571 + 08358023ceab8b055af5c3594b3dcc2c url - http://downloads.phoenixviewer.com/dullahan_gcc5-1.1.1313_3.3626.1895.g7001d56-linux64-190760044.tar.bz2 + http://downloads.phoenixviewer.com/dullahan_gcc5-1.1.1320_3.3626.1895.g7001d56-linux64-190811112.tar.bz2 name linux64 @@ -838,9 +838,9 @@ archive hash - ccee21f79ca1628c38c55295cd2544e6 + 607f824220ac11cdc7ae9b5297f5f57a url - http://downloads.phoenixviewer.com/dullahan-1.1.1313_3.3626.1895.g7001d56-linux64-190760005.tar.bz2 + http://downloads.phoenixviewer.com/dullahan-1.1.1320_3.3626.1895.g7001d56-linux64-190811046.tar.bz2 name linux64 From a75856e6c798b923b3c7fb29aa9bc7545446fafb Mon Sep 17 00:00:00 2001 From: Liny Date: Mon, 25 Mar 2019 18:51:07 -0700 Subject: [PATCH 3/7] FIRE-23524 Option to limit look at target to a sphere around the avatar's head. Care of Chaser Zaks --- indra/newview/app_settings/settings.xml | 22 +++++ indra/newview/llhudeffectlookat.cpp | 82 ++++++++++++++++++- .../xui/en/panel_preferences_privacy.xml | 37 +++++++++ 3 files changed, 138 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1cc1dfd244..9c30658a1e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -25157,6 +25157,28 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSLookAtTargetLimitDistance + + Comment + Limit look at target distance from head to value of LookAtTargetMaxDistance + Persist + 1 + Type + Boolean + Value + 0 + + FSLookAtTargetMaxDistance + + Comment + Max lookat distance in meters + Persist + 1 + Type + F32 + Value + 1 + diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 3c29239e30..7ef68ee920 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -476,7 +476,8 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec F32 current_time = mTimer.getElapsedTimeF32(); - // type of lookat behavior or target object has changed + // FIRE-23524 Option to limit look at target to a sphere around the avatar's head. + /*// type of lookat behavior or target object has changed BOOL lookAtChanged = (target_type != mTargetType) || (object != mTargetObject); // lookat position has moved a certain amount and we haven't just sent an update @@ -490,23 +491,98 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec setDuration(timeout); setNeedsSendToSim(TRUE); } - + */ + + static LLCachedControl s_EnableLimiter(gSavedSettings, "FSLookAtTargetLimitDistance"); + + BOOL lookAtShouldClamp = s_EnableLimiter && + (*mAttentions)[mTargetType].mName != "None" && + (*mAttentions)[mTargetType].mName != "Idle" && + (*mAttentions)[mTargetType].mName != "AutoListen"; + + if (!lookAtShouldClamp) //We do a similar but seperate calculation if we are doing limited distances + { + // type of lookat behavior or target object has changed + BOOL lookAtChanged = (target_type != mTargetType) || (object != mTargetObject); + + // lookat position has moved a certain amount and we haven't just sent an update + lookAtChanged = lookAtChanged || ((dist_vec_squared(position, mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE_SQUARED) && + ((current_time - mLastSendTime) > (1.f / MAX_SENDS_PER_SEC))); + + if (lookAtChanged) + { + mLastSentOffsetGlobal = position; + F32 timeout = (*mAttentions)[target_type].mTimeout; + setDuration(timeout); + setNeedsSendToSim(TRUE); + } + } + // FIRE-23524 Option to limit look at target to a sphere around the avatar's head. + + if (target_type == LOOKAT_TARGET_CLEAR) { clearLookAtTarget(); } else { + mTargetType = target_type; mTargetObject = object; if (object) { - mTargetOffsetGlobal.setVec(position); + //mTargetOffsetGlobal.setVec(position); FIRE-23524 Option to limit look at target to a sphere around the avatar's head. + if(lookAtShouldClamp){ + if(mTargetObject->isAvatar() && ((LLVOAvatar*)(LLViewerObject*)mTargetObject)->isSelf()){ + //We use this branch and mimic our mouse/first person look pose. + mTargetOffsetGlobal.setVec(gAgent.getPosGlobalFromAgent(gAgentAvatarp->mHeadp->getWorldPosition() + position)); + mTargetObject = NULL; + }else{ + //Otherwise, mimic looking at the object. + mTargetOffsetGlobal.setVec(object->getPositionGlobal() + (LLVector3d)(position * object->getRotationRegion())); + mTargetObject = NULL; + } + }else{ + mTargetOffsetGlobal.setVec(position); + } } else { mTargetOffsetGlobal = gAgent.getPosGlobalFromAgent(position); } + + // FIRE-23524 Option to limit look at target to a sphere around the avatar's head. + if(lookAtShouldClamp){ + static LLCachedControl s_Radius(gSavedSettings, "FSLookAtTargetMaxDistance"); + + LLVector3d headPosition = gAgent.getPosGlobalFromAgent(gAgentAvatarp->mHeadp->getWorldPosition()); + float distance = dist_vec(mTargetOffsetGlobal, headPosition); + + if (distance > s_Radius) + { + LLVector3d vecDistFromObjectToHead = mTargetOffsetGlobal - headPosition; + vecDistFromObjectToHead *= s_Radius / distance; + mTargetOffsetGlobal.setVec(headPosition + vecDistFromObjectToHead); + } + + //Do the changed calculation except this time for limited distances + // type of lookat behavior or target object has changed + BOOL lookAtChanged = (target_type != mTargetType); + + // lookat position has moved a certain amount and we haven't just sent an update + lookAtChanged = lookAtChanged || ((dist_vec_squared(gAgent.getPosAgentFromGlobal(mTargetOffsetGlobal), mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE_SQUARED) && + ((current_time - mLastSendTime) > (1.f / MAX_SENDS_PER_SEC))); + + if (lookAtChanged) + { + mLastSentOffsetGlobal = gAgent.getPosAgentFromGlobal(mTargetOffsetGlobal); + F32 timeout = (*mAttentions)[target_type].mTimeout; + setDuration(timeout); + setNeedsSendToSim(TRUE); + } + } + FIRE-23524 Option to limit look at target to a sphere around the avatar's head. + mKillTime = mTimer.getElapsedTimeF32() + mDuration; update(); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml index 60c8c9edfe..28b71773ef 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -458,6 +458,43 @@ tool_tip="Prevents your selection point from showing to others" top_pad="4" width="350" /> + + + + m + From 413b91abdda3faade73f42e295b6e9a70998615f Mon Sep 17 00:00:00 2001 From: Liny Date: Mon, 25 Mar 2019 18:55:41 -0700 Subject: [PATCH 4/7] Add Chaser Zaks to credits. --- indra/newview/skins/default/xui/en/floater_about.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index da79b8d2b4..ff31222a61 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -165,7 +165,7 @@ Additional code generously contributed to Firestorm by: top_pad="4" width="450" wrap="true"> -Albatroz Hird, Alexie Birman, Andromeda Rage, Animats, Armin Weatherwax, Beq Janus, Casper Warden, Chalice Yao, Cron Stardust, Damian Zhaoying, Dan Threebeards, Dawa Gurbux, Denver Maksim, Drake Arconis, Felyza Wishbringer, f0rbidden, Fractured Crystal, Geenz Spad, Gibson Firehawk, Hitomi Tiponi, Inusaito Sayori, Jean Severine, Katharine Berry, Kittin Ninetails, Kool Koolhoven, Lance Corrimal, Lassie, Latif Khalifa, Magne Metaverse LLC, Magus Freston, Manami Hokkigai, MartinRJ Fayray, McCabe Maxstead, Melancholy Lemon, Melysmile, Mimika Oh, Mister Acacia, mygoditsfullofstars, Mysty Saunders, Nagi Michinaga, Name Short, nhede Core, NiranV Dean, Nogardrevlis Lectar, Paladin Forzane, paperwork, Penny Patton, Peyton Menges, programmtest, Qwerty Venom, Revolution Smythe, Sahkolihaa Contepomi, sal Kaligawa, Samm Florian, Satomi Ahn, Sei Lisa, Sempervirens Oddfellow, Shin Wasp, Shyotl Kuhr, Sione Lomu, Skills Hak, StarlightShining, Sunset Faulkes, Thickbrick Sleaford, Vaalith Jinn, Vincent Sylvester, Whirly Fizzle, Xenhat Liamano, Zwagoth Klaar and others. +Albatroz Hird, Alexie Birman, Andromeda Rage, Animats, Armin Weatherwax, Beq Janus, Casper Warden, Chalice Yao, Chaser Zaks, Cron Stardust, Damian Zhaoying, Dan Threebeards, Dawa Gurbux, Denver Maksim, Drake Arconis, Felyza Wishbringer, f0rbidden, Fractured Crystal, Geenz Spad, Gibson Firehawk, Hitomi Tiponi, Inusaito Sayori, Jean Severine, Katharine Berry, Kittin Ninetails, Kool Koolhoven, Lance Corrimal, Lassie, Latif Khalifa, Magne Metaverse LLC, Magus Freston, Manami Hokkigai, MartinRJ Fayray, McCabe Maxstead, Melancholy Lemon, Melysmile, Mimika Oh, Mister Acacia, mygoditsfullofstars, Mysty Saunders, Nagi Michinaga, Name Short, nhede Core, NiranV Dean, Nogardrevlis Lectar, Paladin Forzane, paperwork, Penny Patton, Peyton Menges, programmtest, Qwerty Venom, Revolution Smythe, Sahkolihaa Contepomi, sal Kaligawa, Samm Florian, Satomi Ahn, Sei Lisa, Sempervirens Oddfellow, Shin Wasp, Shyotl Kuhr, Sione Lomu, Skills Hak, StarlightShining, Sunset Faulkes, Thickbrick Sleaford, Vaalith Jinn, Vincent Sylvester, Whirly Fizzle, Xenhat Liamano, Zwagoth Klaar and others. Date: Tue, 26 Mar 2019 13:03:01 +0100 Subject: [PATCH 5/7] Make the code compile again. --- indra/newview/llhudeffectlookat.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 7ef68ee920..6a1c3fbaa8 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -532,17 +532,23 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec if (object) { //mTargetOffsetGlobal.setVec(position); FIRE-23524 Option to limit look at target to a sphere around the avatar's head. - if(lookAtShouldClamp){ - if(mTargetObject->isAvatar() && ((LLVOAvatar*)(LLViewerObject*)mTargetObject)->isSelf()){ + if(lookAtShouldClamp) + { + if(mTargetObject->isAvatar() && ((LLVOAvatar*)(LLViewerObject*)mTargetObject)->isSelf()) + { //We use this branch and mimic our mouse/first person look pose. mTargetOffsetGlobal.setVec(gAgent.getPosGlobalFromAgent(gAgentAvatarp->mHeadp->getWorldPosition() + position)); mTargetObject = NULL; - }else{ + } + else + { //Otherwise, mimic looking at the object. mTargetOffsetGlobal.setVec(object->getPositionGlobal() + (LLVector3d)(position * object->getRotationRegion())); mTargetObject = NULL; } - }else{ + } + else + { mTargetOffsetGlobal.setVec(position); } } @@ -552,7 +558,8 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec } // FIRE-23524 Option to limit look at target to a sphere around the avatar's head. - if(lookAtShouldClamp){ + if(lookAtShouldClamp) + { static LLCachedControl s_Radius(gSavedSettings, "FSLookAtTargetMaxDistance"); LLVector3d headPosition = gAgent.getPosGlobalFromAgent(gAgentAvatarp->mHeadp->getWorldPosition()); @@ -570,8 +577,9 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec BOOL lookAtChanged = (target_type != mTargetType); // lookat position has moved a certain amount and we haven't just sent an update - lookAtChanged = lookAtChanged || ((dist_vec_squared(gAgent.getPosAgentFromGlobal(mTargetOffsetGlobal), mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE_SQUARED) && - ((current_time - mLastSendTime) > (1.f / MAX_SENDS_PER_SEC))); + lookAtChanged = lookAtChanged || + ((dist_vec_squared(gAgent.getPosAgentFromGlobal(mTargetOffsetGlobal), mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE_SQUARED) && + ((current_time - mLastSendTime) > (1.f / MAX_SENDS_PER_SEC))); if (lookAtChanged) { @@ -581,7 +589,7 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec setNeedsSendToSim(TRUE); } } - FIRE-23524 Option to limit look at target to a sphere around the avatar's head. + // FIRE-23524 Option to limit look at target to a sphere around the avatar's head. mKillTime = mTimer.getElapsedTimeF32() + mDuration; From e099d7a0336384e6756f89443db7083d080fedd4 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 26 Mar 2019 20:06:47 +0100 Subject: [PATCH 6/7] Clean this up and add German translation --- indra/newview/llhudeffectlookat.cpp | 183 ++++++++++-------- .../xui/de/panel_preferences_privacy.xml | 4 + .../xui/en/panel_preferences_privacy.xml | 7 +- 3 files changed, 104 insertions(+), 90 deletions(-) diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 6a1c3fbaa8..c1bbc1344d 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -477,120 +477,131 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec F32 current_time = mTimer.getElapsedTimeF32(); // FIRE-23524 Option to limit look at target to a sphere around the avatar's head. - /*// type of lookat behavior or target object has changed - BOOL lookAtChanged = (target_type != mTargetType) || (object != mTargetObject); + //// type of lookat behavior or target object has changed + //BOOL lookAtChanged = (target_type != mTargetType) || (object != mTargetObject); - // lookat position has moved a certain amount and we haven't just sent an update - lookAtChanged = lookAtChanged || ((dist_vec_squared(position, mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE_SQUARED) && - ((current_time - mLastSendTime) > (1.f / MAX_SENDS_PER_SEC))); + //// lookat position has moved a certain amount and we haven't just sent an update + //lookAtChanged = lookAtChanged || ((dist_vec_squared(position, mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE_SQUARED) && + // ((current_time - mLastSendTime) > (1.f / MAX_SENDS_PER_SEC))); - if (lookAtChanged) + //if (lookAtChanged) + //{ + // mLastSentOffsetGlobal = position; + // F32 timeout = (*mAttentions)[target_type].mTimeout; + // setDuration(timeout); + // setNeedsSendToSim(TRUE); + //} + // + //if (target_type == LOOKAT_TARGET_CLEAR) + //{ + // clearLookAtTarget(); + //} + //else + //{ + // mTargetType = target_type; + // mTargetObject = object; + // if (object) + // { + // mTargetOffsetGlobal.setVec(position); + // } + // else + // { + // mTargetOffsetGlobal = gAgent.getPosGlobalFromAgent(position); + // } + //} + + static LLCachedControl s_EnableLimiter(gSavedSettings, "FSLookAtTargetLimitDistance"); + bool lookAtShouldClamp = s_EnableLimiter && + (*mAttentions)[mTargetType].mName != "None" && + (*mAttentions)[mTargetType].mName != "Idle" && + (*mAttentions)[mTargetType].mName != "AutoListen"; + + if (!lookAtShouldClamp) //We do a similar but seperate calculation if we are doing limited distances { - mLastSentOffsetGlobal = position; - F32 timeout = (*mAttentions)[target_type].mTimeout; - setDuration(timeout); - setNeedsSendToSim(TRUE); + // type of lookat behavior or target object has changed + bool lookAtChanged = (target_type != mTargetType) || (object != mTargetObject); + + // lookat position has moved a certain amount and we haven't just sent an update + lookAtChanged = lookAtChanged || ((dist_vec_squared(position, mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE_SQUARED) && + ((current_time - mLastSendTime) > (1.f / MAX_SENDS_PER_SEC))); + + if (lookAtChanged) + { + mLastSentOffsetGlobal = position; + F32 timeout = (*mAttentions)[target_type].mTimeout; + setDuration(timeout); + setNeedsSendToSim(TRUE); + } } - */ - static LLCachedControl s_EnableLimiter(gSavedSettings, "FSLookAtTargetLimitDistance"); - - BOOL lookAtShouldClamp = s_EnableLimiter && - (*mAttentions)[mTargetType].mName != "None" && - (*mAttentions)[mTargetType].mName != "Idle" && - (*mAttentions)[mTargetType].mName != "AutoListen"; - - if (!lookAtShouldClamp) //We do a similar but seperate calculation if we are doing limited distances - { - // type of lookat behavior or target object has changed - BOOL lookAtChanged = (target_type != mTargetType) || (object != mTargetObject); - - // lookat position has moved a certain amount and we haven't just sent an update - lookAtChanged = lookAtChanged || ((dist_vec_squared(position, mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE_SQUARED) && - ((current_time - mLastSendTime) > (1.f / MAX_SENDS_PER_SEC))); - - if (lookAtChanged) - { - mLastSentOffsetGlobal = position; - F32 timeout = (*mAttentions)[target_type].mTimeout; - setDuration(timeout); - setNeedsSendToSim(TRUE); - } - } - // FIRE-23524 Option to limit look at target to a sphere around the avatar's head. - - if (target_type == LOOKAT_TARGET_CLEAR) { clearLookAtTarget(); } else { - mTargetType = target_type; mTargetObject = object; if (object) { - //mTargetOffsetGlobal.setVec(position); FIRE-23524 Option to limit look at target to a sphere around the avatar's head. - if(lookAtShouldClamp) + if (lookAtShouldClamp) { - if(mTargetObject->isAvatar() && ((LLVOAvatar*)(LLViewerObject*)mTargetObject)->isSelf()) + if (mTargetObject->isAvatar() && ((LLVOAvatar*)(LLViewerObject*)mTargetObject)->isSelf()) { - //We use this branch and mimic our mouse/first person look pose. - mTargetOffsetGlobal.setVec(gAgent.getPosGlobalFromAgent(gAgentAvatarp->mHeadp->getWorldPosition() + position)); - mTargetObject = NULL; - } + //We use this branch and mimic our mouse/first person look pose. + mTargetOffsetGlobal.setVec(gAgent.getPosGlobalFromAgent(gAgentAvatarp->mHeadp->getWorldPosition() + position)); + mTargetObject = NULL; + } else { - //Otherwise, mimic looking at the object. - mTargetOffsetGlobal.setVec(object->getPositionGlobal() + (LLVector3d)(position * object->getRotationRegion())); - mTargetObject = NULL; - } - } + //Otherwise, mimic looking at the object. + mTargetOffsetGlobal.setVec(object->getPositionGlobal() + (LLVector3d)(position * object->getRotationRegion())); + mTargetObject = NULL; + } + } else { - mTargetOffsetGlobal.setVec(position); - } + mTargetOffsetGlobal.setVec(position); + } } else { mTargetOffsetGlobal = gAgent.getPosGlobalFromAgent(position); } - - // FIRE-23524 Option to limit look at target to a sphere around the avatar's head. - if(lookAtShouldClamp) - { - static LLCachedControl s_Radius(gSavedSettings, "FSLookAtTargetMaxDistance"); - - LLVector3d headPosition = gAgent.getPosGlobalFromAgent(gAgentAvatarp->mHeadp->getWorldPosition()); - float distance = dist_vec(mTargetOffsetGlobal, headPosition); - - if (distance > s_Radius) - { - LLVector3d vecDistFromObjectToHead = mTargetOffsetGlobal - headPosition; - vecDistFromObjectToHead *= s_Radius / distance; - mTargetOffsetGlobal.setVec(headPosition + vecDistFromObjectToHead); - } - - //Do the changed calculation except this time for limited distances - // type of lookat behavior or target object has changed - BOOL lookAtChanged = (target_type != mTargetType); - - // lookat position has moved a certain amount and we haven't just sent an update - lookAtChanged = lookAtChanged || - ((dist_vec_squared(gAgent.getPosAgentFromGlobal(mTargetOffsetGlobal), mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE_SQUARED) && - ((current_time - mLastSendTime) > (1.f / MAX_SENDS_PER_SEC))); - if (lookAtChanged) - { - mLastSentOffsetGlobal = gAgent.getPosAgentFromGlobal(mTargetOffsetGlobal); - F32 timeout = (*mAttentions)[target_type].mTimeout; - setDuration(timeout); - setNeedsSendToSim(TRUE); - } - } + if (lookAtShouldClamp) + { + static LLCachedControl s_Radius(gSavedSettings, "FSLookAtTargetMaxDistance"); + + LLVector3d headPosition = gAgent.getPosGlobalFromAgent(gAgentAvatarp->mHeadp->getWorldPosition()); + float distance = dist_vec(mTargetOffsetGlobal, headPosition); + + if (distance > s_Radius) + { + LLVector3d vecDistFromObjectToHead = mTargetOffsetGlobal - headPosition; + vecDistFromObjectToHead *= s_Radius / distance; + mTargetOffsetGlobal.setVec(headPosition + vecDistFromObjectToHead); + } + + //Do the changed calculation except this time for limited distances + // type of lookat behavior or target object has changed + bool lookAtChanged = (target_type != mTargetType); + + // lookat position has moved a certain amount and we haven't just sent an update + lookAtChanged = lookAtChanged || + ((dist_vec_squared(gAgent.getPosAgentFromGlobal(mTargetOffsetGlobal), mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE_SQUARED) && + ((current_time - mLastSendTime) > (1.f / MAX_SENDS_PER_SEC))); + + if (lookAtChanged) + { + mLastSentOffsetGlobal = gAgent.getPosAgentFromGlobal(mTargetOffsetGlobal); + F32 timeout = (*mAttentions)[target_type].mTimeout; + setDuration(timeout); + setNeedsSendToSim(TRUE); + } + } // FIRE-23524 Option to limit look at target to a sphere around the avatar's head. - + mKillTime = mTimer.getElapsedTimeF32() + mDuration; update(); diff --git a/indra/newview/skins/default/xui/de/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/de/panel_preferences_privacy.xml index 77983a5271..01be173b89 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_privacy.xml @@ -76,6 +76,10 @@ + + + m + diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml index 28b71773ef..03e2e2e982 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -467,17 +467,16 @@ name="LimitLookAt" tool_tip="Clamps your look at target around your head." top_pad="4" - width="350" /> + width="160" /> From 0a98f437ed7d4b2c209d34f3c434fe908263354a Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Wed, 27 Mar 2019 17:22:57 +0100 Subject: [PATCH 7/7] Polish translation update --- indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml index 62ed3599e5..552a28b7cf 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml @@ -70,6 +70,7 @@ +