diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-09-28 22:29:19 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-09-28 22:29:19 +0300 |
commit | 1d458de94934d0d56cef15596d414f155db166a0 (patch) | |
tree | 8c835b12674ca0dab4214496974848c27babd139 /indra/newview/llmaniprotate.cpp | |
parent | e9d50aeb3d1fa6b6251296f792d75cbc480f68fb (diff) | |
parent | bac6652cdcd2d8333df04c3ebd3a6a7b752328b3 (diff) |
Merge branch 'master' into DRTVWR-515-maint
# Conflicts:
# indra/newview/llpanelprimmediacontrols.cpp
Diffstat (limited to 'indra/newview/llmaniprotate.cpp')
-rw-r--r-- | indra/newview/llmaniprotate.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index f158aae3d2..c3e39429a2 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -447,6 +447,7 @@ BOOL LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) } mMouseCur = mMouseDown; + mAgentSelfAtAxis = gAgent.getAtAxis(); // no point checking if avatar was selected, just save the value // Route future Mouse messages here preemptively. (Release on mouse up.) setMouseCapture( TRUE ); @@ -610,6 +611,26 @@ void LLManipRotate::drag( S32 x, S32 y ) else { object->setRotation(new_rot, damped); + LLVOAvatar* avatar = object->asAvatar(); + if (avatar && avatar->isSelf() + && LLSelectMgr::getInstance()->mAllowSelectAvatar + && !object->getParent()) + { + // Normal avatars use object's orienttion, but self uses + // separate LLCoordFrame + // See LVOAvatar::updateOrientation() + if (gAgentCamera.getFocusOnAvatar()) + { + //Don't rotate camera with avatar + gAgentCamera.setFocusOnAvatar(false, false, false); + } + + LLVector3 at_axis = mAgentSelfAtAxis; + at_axis *= mRotation; + at_axis.mV[VZ] = 0.f; + at_axis.normalize(); + gAgent.resetAxes(at_axis); + } rebuild(object); } @@ -717,7 +738,7 @@ void LLManipRotate::drag( S32 x, S32 y ) LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit(); if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && ((root_object == NULL) || !root_object->isPermanentEnforced()) && - !cur->isAvatar()) + (!cur->isAvatar() || LLSelectMgr::getInstance()->mAllowSelectAvatar)) { selectNode->mLastRotation = cur->getRotation(); selectNode->mLastPositionLocal = cur->getPosition(); |