summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r--indra/newview/llagent.cpp55
1 files changed, 30 insertions, 25 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index fb0d3bd58c..e07375b0bd 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);
@@ -3302,16 +3304,15 @@ void LLAgent::sendAnimationRequests(const std::vector<LLUUID> &anim_ids, EAnimRe
msg->addUUIDFast(_PREHASH_AgentID, getID());
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
- for (S32 i = 0; i < anim_ids.size(); i++)
+ for (const LLUUID& uuid : anim_ids)
{
- if (anim_ids[i].isNull())
+ if (uuid.notNull())
{
- continue;
+ msg->nextBlockFast(_PREHASH_AnimationList);
+ msg->addUUIDFast(_PREHASH_AnimID, uuid);
+ msg->addBOOLFast(_PREHASH_StartAnim, request == ANIM_REQUEST_START);
+ num_valid_anims++;
}
- msg->nextBlockFast(_PREHASH_AnimationList);
- msg->addUUIDFast(_PREHASH_AnimID, (anim_ids[i]) );
- msg->addBOOLFast(_PREHASH_StartAnim, (request == ANIM_REQUEST_START) ? true : false);
- num_valid_anims++;
}
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
@@ -3336,8 +3337,8 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request)
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
msg->nextBlockFast(_PREHASH_AnimationList);
- msg->addUUIDFast(_PREHASH_AnimID, (anim_id) );
- msg->addBOOLFast(_PREHASH_StartAnim, (request == ANIM_REQUEST_START) ? true : false);
+ msg->addUUIDFast(_PREHASH_AnimID, anim_id);
+ msg->addBOOLFast(_PREHASH_StartAnim, request == ANIM_REQUEST_START);
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0);
@@ -4334,6 +4335,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();
}