diff options
| author | Brad Linden <brad@lindenlab.com> | 2024-08-09 17:57:23 -0700 |
|---|---|---|
| committer | Brad Linden <brad@lindenlab.com> | 2024-08-09 17:57:23 -0700 |
| commit | a7fde9d79c517bfc6165756c1bc3eb16fa4d935c (patch) | |
| tree | f0608f7f72f23a447778f8bce6f210eb221ebdf1 /indra/newview/llhudeffectlookat.cpp | |
| parent | ac330f63fd7ac655bbd06ce5d4ed65430aa2f42a (diff) | |
| parent | c106221726c48a4231b7854bff224ae422c0517f (diff) | |
Merge remote-tracking branch release/2024.06-atlasaurus into 'develop'
Diffstat (limited to 'indra/newview/llhudeffectlookat.cpp')
| -rw-r--r-- | indra/newview/llhudeffectlookat.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index c8b7e00776..d0d2ee191a 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -36,6 +36,7 @@ #include "llvoavatar.h" #include "lldrawable.h" #include "llviewerobjectlist.h" +#include "llviewercontrol.h" #include "llrendersphere.h" #include "llselectmgr.h" #include "llglheaders.h" @@ -561,8 +562,16 @@ void LLHUDEffectLookAt::update() { if (calcTargetPosition()) { + static LLCachedControl<bool> disable_look_at(gSavedSettings, "DisableLookAtAnimation", true); LLMotion* head_motion = ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->findMotion(ANIM_AGENT_HEAD_ROT); - if (!head_motion || head_motion->isStopped()) + if (disable_look_at()) + { + if (head_motion) + { + ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->stopMotion(ANIM_AGENT_HEAD_ROT); + } + } + else if (!head_motion || head_motion->isStopped()) { ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->startMotion(ANIM_AGENT_HEAD_ROT); } @@ -665,7 +674,15 @@ bool LLHUDEffectLookAt::calcTargetPosition() if (!mTargetPos.isFinite()) return false; - source_avatar->setAnimationData("LookAtPoint", (void *)&mTargetPos); + static LLCachedControl<bool> disable_look_at(gSavedSettings, "DisableLookAtAnimation", true); + if (disable_look_at()) + { + source_avatar->removeAnimationData("LookAtPoint"); + } + else + { + source_avatar->setAnimationData("LookAtPoint", (void*)&mTargetPos); + } return true; } |
