summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-04-24 09:43:04 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-04-24 09:43:04 -0400
commitfc71a9c1ed96cb1cb97124e3cceabdfa11e1cc75 (patch)
treeb8e19975b3acc800aeaf8c541a780dbb84dc1fd3 /indra/newview/llagent.cpp
parenta3cbd41543258818589dd0e368c68d2dc62b3398 (diff)
parent5e40b5e64433b224be4dc220e4496dcd0a43f3f6 (diff)
Merge release/maint-yz to main on promotion of secondlife/viewer #736: Maintenance YZ 7.1.6.8745209917
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();
}