From c0f06191c28d4aa2d3b3d23dd6d00b2fe6b067e6 Mon Sep 17 00:00:00 2001 From: Kyler Eastridge Date: Sun, 27 Jul 2025 18:04:35 +0100 Subject: [PATCH 01/12] Add option to disable selection hints --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llhudeffectpointat.cpp | 7 +++++++ indra/newview/llvoavatarself.cpp | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 27e3a95092..f0b7c089cf 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16234,5 +16234,16 @@ Value 1 + EnableSelectionHints + + Comment + Whether or not to send editing hints to animate the arm when editing an object. + Persist + 1 + Type + Boolean + Value + 1 + diff --git a/indra/newview/llhudeffectpointat.cpp b/indra/newview/llhudeffectpointat.cpp index eeb38cd6aa..23ab0e873d 100644 --- a/indra/newview/llhudeffectpointat.cpp +++ b/indra/newview/llhudeffectpointat.cpp @@ -34,6 +34,7 @@ #include "llagent.h" #include "llagentcamera.h" #include "lldrawable.h" +#include "llviewercontrol.h" #include "llviewerobjectlist.h" #include "llvoavatar.h" #include "message.h" @@ -221,6 +222,12 @@ void LLHUDEffectPointAt::setTargetPosGlobal(const LLVector3d &target_pos_global) //----------------------------------------------------------------------------- bool LLHUDEffectPointAt::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position) { + static LLCachedControl enable_selection_hints(gSavedSettings, "EnableSelectionHints", true); + if (!enable_selection_hints) + { + return false; + } + if (!mSourceObject) { return false; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 8da48910c6..653c7e82eb 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2830,6 +2830,12 @@ void LLVOAvatarSelf::setHoverOffset(const LLVector3& hover_offset, bool send_upd //------------------------------------------------------------------------ bool LLVOAvatarSelf::needsRenderBeam() { + static LLCachedControl enable_selection_hints(gSavedSettings, "EnableSelectionHints", true); + if (!enable_selection_hints) + { + return false; + } + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); bool is_touching_or_grabbing = (tool == LLToolGrab::getInstance() && LLToolGrab::getInstance()->isEditing()); From f0cdcdc5ec7fb30d95f24faf2783717cd65bfa67 Mon Sep 17 00:00:00 2001 From: Kyler Eastridge Date: Sun, 27 Jul 2025 18:14:52 +0100 Subject: [PATCH 02/12] Add ability to disable look at hints --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llhudeffectlookat.cpp | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f0b7c089cf..0ce01dc20d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16245,5 +16245,16 @@ Value 1 + EnableLookAtHints + + Comment + Whether or not to send animate the avatar head and send look at hints when moving the cursor or focusing on objects + Persist + 1 + Type + Boolean + Value + 1 + diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index d0d2ee191a..845a003500 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -392,6 +392,12 @@ void LLHUDEffectLookAt::setTargetPosGlobal(const LLVector3d &target_pos_global) //----------------------------------------------------------------------------- bool LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVector3 position) { + static LLCachedControl enable_lookat_hints(gSavedSettings, "EnableLookAtHints", true); + if (!enable_lookat_hints) + { + return false; + } + if (!mSourceObject) { return false; From b0541de45348a09b634e460cd5ad12c823e2bc3c Mon Sep 17 00:00:00 2001 From: Kyler Eastridge Date: Mon, 28 Jul 2025 02:51:19 +0100 Subject: [PATCH 03/12] Initial limit look at distance code --- indra/newview/app_settings/settings.xml | 22 +++++++++++++++++++++ indra/newview/llhudeffectlookat.cpp | 26 ++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0ce01dc20d..a86a65fe13 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16256,5 +16256,27 @@ Value 1 + LimitLookAtHints + + Comment + Whether or not to clamp the look at targets around the avatar head before sending + Persist + 1 + Type + Boolean + Value + 1 + + LimitLookAtHintsDistance + + Comment + Distance to limit look at target to + Persist + 1 + Type + F32 + Value + 4 + diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 845a003500..f726ef1354 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -37,6 +37,7 @@ #include "lldrawable.h" #include "llviewerobjectlist.h" #include "llviewercontrol.h" +#include "llvoavatarself.h" #include "llrendersphere.h" #include "llselectmgr.h" #include "llglheaders.h" @@ -390,7 +391,7 @@ void LLHUDEffectLookAt::setTargetPosGlobal(const LLVector3d &target_pos_global) // setLookAt() // called by agent logic to set look at behavior locally, and propagate to sim //----------------------------------------------------------------------------- -bool LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVector3 position) +bool LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject* object, LLVector3 position) { static LLCachedControl enable_lookat_hints(gSavedSettings, "EnableLookAtHints", true); if (!enable_lookat_hints) @@ -415,6 +416,29 @@ bool LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec return false; } + static LLCachedControl limit_lookat_hints(gSavedSettings, "LimitLookAtHints", true); + // Don't affect the look at if object is gAgentAvatarp (cursor head follow) + if (limit_lookat_hints && object != gAgentAvatarp) + { + // If it is a object + if (object) + { + position += object->getRenderPosition(); + object = NULL; + } + + LLVector3 agentHeadPosition = gAgentAvatarp->mHeadp->getWorldPosition(); + float dist = (float)dist_vec(agentHeadPosition, position); + + static LLCachedControl limit_lookat_hints_distance(gSavedSettings, "LimitLookAtHintsDistance", 2.0f); + if (dist > limit_lookat_hints_distance) + { + LLVector3 headOffset = position - agentHeadPosition; + headOffset *= limit_lookat_hints_distance / dist; + position.setVec(agentHeadPosition + headOffset); + } + } + F32 current_time = mTimer.getElapsedTimeF32(); // type of lookat behavior or target object has changed From 2165107f9a677bee94cd9e9f4b1b4244a8566b96 Mon Sep 17 00:00:00 2001 From: Kyler Eastridge Date: Mon, 28 Jul 2025 03:21:54 +0100 Subject: [PATCH 04/12] Expose lookat and selection hint privacy settings --- .../xui/en/panel_preferences_privacy.xml | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) 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 5041fb4878..c651d58f3b 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -63,7 +63,7 @@ name="online_visibility" top_pad="30" width="350" /> - + + + +