Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions indra/newview/app_settings/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16234,5 +16234,49 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>EnableSelectionHints</key>
<map>
<key>Comment</key>
<string>Whether or not to send editing hints to animate the arm when editing an object.</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs to be a bit more clear about what 'editing hints' is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would "Whether or not to send a particle beam and animate the arm when selecting a object" be more explanatory? Trying to figure out the best way to word it without it getting to wordy.

Copy link
Contributor

@akleshchev akleshchev Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Enable sending and visualizing curent selection using 'beam' particles and arm animation?

<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>EnableLookAtTarget</key>
<map>
<key>Comment</key>
<string>Whether or not to animate the avatar head and send look at targets when moving the cursor or focusing on objects</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>LimitLookAtTarget</key>
<map>
<key>Comment</key>
<string>Whether or not to clamp the look at targets around the avatar head before sending</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>LimitLookAtTargetDistance</key>
<map>
<key>Comment</key>
<string>Distance to limit look at target to</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<integer>2</integer>
</map>
</map>
</llsd>
39 changes: 39 additions & 0 deletions indra/newview/llhudeffectlookat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -397,6 +398,21 @@ bool LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec
return false;
}

static LLCachedControl<bool> enable_lookat_hints(gSavedSettings, "EnableLookAtTarget", true);
if (!enable_lookat_hints)
{
// Clear the effect so it doesn't linger around if it gets disabled
if (mTargetType != LOOKAT_TARGET_IDLE)
{
mTargetObject = gAgentAvatarp;
mTargetType = LOOKAT_TARGET_IDLE;
mTargetOffsetGlobal.set(2.f, 0.f, 0.f);
setDuration(3.f);
setNeedsSendToSim(true);
}
return false;
}

if (target_type >= LOOKAT_NUM_TARGETS)
{
LL_WARNS() << "Bad target_type " << (int)target_type << " - ignoring." << LL_ENDL;
Expand All @@ -409,6 +425,29 @@ bool LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec
return false;
}

static LLCachedControl<bool> limit_lookat_hints(gSavedSettings, "LimitLookAtTarget", 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<F32> limit_lookat_hints_distance(gSavedSettings, "LimitLookAtTargetDistance", 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
Expand Down
14 changes: 14 additions & 0 deletions indra/newview/llhudeffectpointat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -226,6 +227,19 @@ bool LLHUDEffectPointAt::setPointAt(EPointAtType target_type, LLViewerObject *ob
return false;
}

static LLCachedControl<bool> enable_selection_hints(gSavedSettings, "EnableSelectionHints", true);
if (!enable_selection_hints)
{
// Clear the effect so it doesn't linger around if it gets disabled
if (mTargetType != POINTAT_TARGET_NONE)
{
clearPointAtTarget();
setDuration(1.f);
setNeedsSendToSim(true);
}
return false;
}

if (target_type >= POINTAT_NUM_TARGETS)
{
LL_WARNS() << "Bad target_type " << (int)target_type << " - ignoring." << LL_ENDL;
Expand Down
6 changes: 6 additions & 0 deletions indra/newview/llvoavatarself.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2830,6 +2830,12 @@ void LLVOAvatarSelf::setHoverOffset(const LLVector3& hover_offset, bool send_upd
//------------------------------------------------------------------------
bool LLVOAvatarSelf::needsRenderBeam()
{
static LLCachedControl<bool> enable_selection_hints(gSavedSettings, "EnableSelectionHints", true);
Copy link
Contributor

@akleshchev akleshchev Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going not only not send the beam to server, but also not render it locally, is it intended?

Also feels like it should be only for normal selection, not for grabbing. If person is dragging a physical object around, I would argue that source should be obvious to observers via selection beam (assuming it works like that currently).

Copy link
Contributor Author

@FelixWolf FelixWolf Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was intended because I felt it should maintain consistency between what the resident who has the setting disabled sees and what everyone else sees, as inconsistency would cause confusion.

However as for the other part, My understanding was to disable all selection hints, including grabbing objects. I can modify it so that it only applies to the normal selection if that is desired.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylelinden @bennettgoble What's your opinion on that? Should dragged physical object still display selection beam or should it be possible to hide as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should hide that as well. So, current implementation appears to be good.

if (!enable_selection_hints)
{
return false;
}

LLTool *tool = LLToolMgr::getInstance()->getCurrentTool();

bool is_touching_or_grabbing = (tool == LLToolGrab::getInstance() && LLToolGrab::getInstance()->isEditing());
Expand Down
33 changes: 32 additions & 1 deletion indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
name="online_visibility"
top_pad="30"
width="350" />

<check_box
enabled_control="EnableVoiceChat"
control_name="AutoDisengageMic"
Expand All @@ -74,6 +74,37 @@
name="auto_disengage_mic_check"
top_pad="10"
width="350" />
<check_box
control_name="EnableLookAtTarget"
height="16"
label="Enable LookAt"
tool_tip="Enable tracking cursor position with avatar head's rotation"
layout="topleft"
left="30"
name="enable_lookat_target"
top_pad="10"
width="350" />
<check_box
enabled_control="EnableLookAtTarget"
control_name="LimitLookAtTarget"
height="16"
label="Limit LookAt Distance"
tool_tip="Limit the look at target's distance by restricting it around the avatar's head"
layout="topleft"
left="50"
name="limit_lookat_distance"
top_pad="10"
width="350" />
<check_box
control_name="EnableSelectionHints"
height="16"
label="Enable Selection Hints"
tool_tip="Enable reporting and tracking current selection using 'beam' particles and character animations"
layout="topleft"
left="30"
name="enable_selection_hints"
top_pad="10"
width="350" />
<button
follows="left|top"
height="23"
Expand Down
Loading