summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-06-29 18:00:26 -0500
committerDave Parks <davep@lindenlab.com>2022-06-29 18:00:26 -0500
commit56ae3e0a083aefcbd6d7c955bb2c7e9e58000a4b (patch)
tree53ad2998536760442a00b1d239a7223e864ba3c9 /indra/newview/llagent.cpp
parentfd6b5ea8c3df7e8b4b648ac7ecc9f30eedd4b7c0 (diff)
parent36fd0f7ca932cce5cd3614c16cd26aceedf57952 (diff)
Merge branch 'DRTVWR-559' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r--indra/newview/llagent.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index b79af04c36..7f6f6e5997 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -713,6 +713,12 @@ void LLAgent::moveYaw(F32 mag, bool reset_view)
setControlFlags(AGENT_CONTROL_YAW_NEG);
}
+ U32 mask = AGENT_CONTROL_YAW_POS | AGENT_CONTROL_YAW_NEG;
+ if ((getControlFlags() & mask) == mask)
+ {
+ gAgentCamera.setYawKey(0);
+ }
+
if (reset_view)
{
gAgentCamera.resetView();
@@ -2005,6 +2011,27 @@ void LLAgent::updateAgentPosition(const F32 dt, const F32 yaw_radians, const S32
//
gAgentCamera.updateLookAt(mouse_x, mouse_y);
+
+ // When agent has no parents, position updates come from setPositionAgent()
+ // But when agent has a parent (ex: is seated), position remains unchanged
+ // relative to parent and no parent's position update trigger
+ // setPositionAgent().
+ // But EEP's sky track selection still needs an update if agent has a parent
+ // and parent moves (ex: vehicles).
+ if (isAgentAvatarValid()
+ && gAgentAvatarp->getParent()
+ && !mOnPositionChanged.empty()
+ )
+ {
+ LLVector3d new_position = getPositionGlobal();
+ if ((mLastTestGlobal - new_position).lengthSquared() > 1.0)
+ {
+ // If the position has changed by more than 1 meter since the last time we triggered.
+ // filters out some noise.
+ mLastTestGlobal = new_position;
+ mOnPositionChanged(mFrameAgent.getOrigin(), new_position);
+ }
+ }
}
// friends and operators