summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-08-26 16:27:16 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-08-26 16:27:16 +0300
commit31c13ffe251a6b638ace0f14e20ccbfaf9adcb1b (patch)
treecdb194188daaf5c0b26c8ab8a7ec7dc57cc6251e /indra/newview
parent1cd65a244736d0c11f5740f8a19f8d5459d5d4b6 (diff)
SL-10326 Fixed avatar rotation of selected avatars and selected self
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llmaniprotate.cpp23
-rw-r--r--indra/newview/llmaniprotate.h1
-rw-r--r--indra/newview/llviewerwindow.cpp2
3 files changed, 24 insertions, 2 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();
diff --git a/indra/newview/llmaniprotate.h b/indra/newview/llmaniprotate.h
index e8f1c24c58..dc36ef796a 100644
--- a/indra/newview/llmaniprotate.h
+++ b/indra/newview/llmaniprotate.h
@@ -95,6 +95,7 @@ private:
LLVector3 mMouseDown;
LLVector3 mMouseCur;
+ LLVector3 mAgentSelfAtAxis; // Own agent uses separate rotation method
F32 mRadiusMeters;
LLVector3 mCenterToCam;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 347acfe15f..5b83cf7163 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3930,7 +3930,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
draw_handles = FALSE;
}
- if (tool == LLToolCompRotate::getInstance() && !all_selected_objects_move)
+ if (tool == LLToolCompRotate::getInstance() && !all_selected_objects_move && !LLSelectMgr::getInstance()->isMovableAvatarSelected())
{
draw_handles = FALSE;
}