diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-08-13 19:21:01 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-08-13 20:04:36 +0300 |
commit | 4043945dc778147738da0e6ee6d404ef7075a6da (patch) | |
tree | f302f963d62a1f7693edbd2630c812452e65deed /indra/newview | |
parent | 0124e8952bd71ef4d0ab83c3c6859191d7591809 (diff) |
SL-15689 EEP doesn't change with height for sitting agents
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llagent.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 41578f2328..4ef9c10de2 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2010,6 +2010,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 |