summaryrefslogtreecommitdiff
path: root/indra/newview/llhudeffectlookat.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-31 21:25:47 +0800
committerErik Kundiman <erik@megapahit.org>2024-09-01 20:43:42 +0800
commit95582654e49422d51b55665c3f2821c848ad1cb8 (patch)
treed6d03a887b8e1b6c3be1b139d63b1638c5d0fdcd /indra/newview/llhudeffectlookat.cpp
parentab3f483a3e5ed213882a83b882095cfdb6a4de57 (diff)
parentb0fefd62adbf51f32434ba077e9f52d8a9241d15 (diff)
Merge remote-tracking branch 'secondlife/release/2024.08-DeltaFPS' into 2024.08-DeltaFPS
Diffstat (limited to 'indra/newview/llhudeffectlookat.cpp')
-rw-r--r--indra/newview/llhudeffectlookat.cpp21
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;
}