diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-04-24 19:28:15 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-04-24 19:28:15 +0300 |
commit | 85f2447b3ddf7e4b91cd5963cb2e7668d48ab2a9 (patch) | |
tree | 494487bbc57c79d17921b7443003d2a118e24ddb /indra/newview/llagent.cpp | |
parent | 398369233fc2621eb447701e26082057fb0c97d7 (diff) | |
parent | d98fc504a1d4bc292ba86acdda053c8b4598a193 (diff) |
Merge branch 'main' into marchcat/a-merge
# Conflicts:
# autobuild.xml
# indra/llimage/llimage.cpp
# indra/llui/llsearcheditor.cpp
# indra/llui/llview.cpp
# indra/newview/llagent.cpp
# indra/newview/llappviewer.cpp
# indra/newview/llfloatercamera.cpp
# indra/newview/llfloatereditsky.cpp
# indra/newview/llfloatereditwater.cpp
# indra/newview/llinventoryfunctions.cpp
# indra/newview/lloutfitgallery.cpp
# indra/newview/lloutfitslist.cpp
# indra/newview/llpanelgroupbulkban.cpp
# indra/newview/llsidepanelappearance.cpp
# indra/newview/llvovolume.cpp
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r-- | indra/newview/llagent.cpp | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index fb0d3bd58c..efa0865b7e 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,24 +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 - bool isMouseLookOn = mControlFlags & AGENT_CONTROL_MOUSELOOK; - const F32 look_down_limit = 179.f * DEG_TO_RAD; - const F32 look_up_limit = (isMouseLookOn ? 1.f : 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) @@ -2330,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); @@ -4334,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(); } |