summaryrefslogtreecommitdiff
path: root/indra/newview/llhudeffectlookat.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-07-26 21:49:36 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-07-29 07:43:22 +0300
commited6148d6c6c554223dc4b2dab0c729d3b5698158 (patch)
tree98a6c77089588800933698d2759d4e9e28009744 /indra/newview/llhudeffectlookat.cpp
parent817bc25b2732dc23295e6a7ac0da5ad142e33434 (diff)
viewer#2113 Optional disable eyes/head follow cursor/lookat
Intended for photography, but there is curently no nice way to present it so it's in debug options until we get some critical mass of features that can be collected into a single whole.
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;
}