summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-04-24 18:45:54 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-04-24 18:45:54 +0300
commit428f21cf795f440f69a772b314f877ea0c6d4741 (patch)
treebc9cea56b8e236f52df392084552018c387cff2c /indra/newview/llagent.cpp
parent09454c53a48e88a9cdd54f68ac507694a766b213 (diff)
parentd98fc504a1d4bc292ba86acdda053c8b4598a193 (diff)
Merge branch 'main' into marchcat/x-merge
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r--indra/newview/llagent.cpp37
1 files changed, 22 insertions, 15 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 3853aaa8fd..13501833b2 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -95,7 +95,6 @@
#include "llworld.h"
#include "llworldmap.h"
#include "stringize.h"
-#include "boost/foreach.hpp"
#include "llcorehttputil.h"
#include "lluiusage.h"
@@ -1469,23 +1468,27 @@ void LLAgent::pitch(F32 angle)
LLVector3 skyward = getReferenceUpVector();
- // SL-19286 Avatar is upside down when viewed from below
- // after left-clicking the mouse on the avatar and dragging down
- //
- // The issue is observed on angle below 10 degrees
- const F32 look_down_limit = 179.f * DEG_TO_RAD;
- const F32 look_up_limit = 10.f * DEG_TO_RAD;
-
- F32 angle_from_skyward = acos(mFrameAgent.getAtAxis() * skyward);
-
// clamp pitch to limits
- if ((angle >= 0.f) && (angle_from_skyward + angle > look_down_limit))
+ if (angle >= 0.f)
{
- angle = look_down_limit - angle_from_skyward;
+ const F32 look_down_limit = 179.f * DEG_TO_RAD;
+ F32 angle_from_skyward = acos(mFrameAgent.getAtAxis() * skyward);
+ if (angle_from_skyward + angle > look_down_limit)
+ {
+ angle = look_down_limit - angle_from_skyward;
+ }
}
- else if ((angle < 0.f) && (angle_from_skyward + angle < look_up_limit))
+ else if (angle < 0.f)
{
- angle = look_up_limit - angle_from_skyward;
+ const F32 look_up_limit = 5.f * DEG_TO_RAD;
+ const LLVector3& viewer_camera_pos = LLViewerCamera::getInstance()->getOrigin();
+ LLVector3 agent_focus_pos = getPosAgentFromGlobal(gAgentCamera.calcFocusPositionTargetGlobal());
+ LLVector3 look_dir = agent_focus_pos - viewer_camera_pos;
+ F32 angle_from_skyward = angle_between(look_dir, skyward);
+ if (angle_from_skyward + angle < look_up_limit)
+ {
+ angle = look_up_limit - angle_from_skyward;
+ }
}
if (fabs(angle) > 1e-4)
@@ -2329,7 +2332,7 @@ void LLAgent::endAnimationUpdateUI()
LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
LLFloaterIMContainer::floater_list_t conversations;
im_box->getDetachedConversationFloaters(conversations);
- BOOST_FOREACH(LLFloater* conversation, conversations)
+ for (LLFloater* conversation : conversations)
{
LL_INFOS() << "skip_list.insert(session_floater): " << conversation->getTitle() << LL_ENDL;
skip_list.insert(conversation);
@@ -4333,6 +4336,10 @@ void LLAgent::teleportRequest(
// Landmark ID = LLUUID::null means teleport home
void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id)
{
+ if (landmark_asset_id.isNull())
+ {
+ gAgentCamera.resetView();
+ }
mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id));
startTeleportRequest();
}