From 1f5bb7be28768fe5341b1ca4b5a5d366f176045e Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 6 Apr 2020 16:03:19 +0300 Subject: SL-12904 FIXED Camera Preset does not restore correctly when sitting --- indra/newview/llagentcamera.cpp | 6 ++---- indra/newview/llviewerkeyboard.cpp | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 5a5a3efc0f..d1da132587 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1805,7 +1805,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) at_axis.normalize(); gAgent.resetAxes(at_axis * ~parent_rot); - local_camera_offset = local_camera_offset * gAgent.getFrameAgent().getQuaternion() * parent_rot; + local_camera_offset = local_camera_offset * parent_rot; } else { @@ -1999,9 +1999,7 @@ LLVector3d LLAgentCamera::getCurrentFocusOffset() LLQuaternion LLAgentCamera::getCurrentAvatarRotation() { LLViewerObject* sit_object = (LLViewerObject*)gAgentAvatarp->getParent(); - LLQuaternion av_rot = gAgent.getFrameAgent().getQuaternion(); - LLQuaternion obj_rot = sit_object ? sit_object->getRenderRotation() : LLQuaternion::DEFAULT; - return av_rot * obj_rot; + return sit_object ? sit_object->getRenderRotation() : gAgent.getFrameAgent().getQuaternion(); } bool LLAgentCamera::isJoystickCameraUsed() diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index e930eb20d3..bccbe61f44 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -345,6 +345,7 @@ void camera_spin_around_ccw_sitting( EKeystate s ) else { //change camera but do not send keystrokes + gAgentCamera.unlockView(); gAgentCamera.setOrbitLeftKey( get_orbit_rate() ); } } @@ -361,6 +362,7 @@ void camera_spin_around_cw_sitting( EKeystate s ) else { //change camera but do not send keystrokes + gAgentCamera.unlockView(); gAgentCamera.setOrbitRightKey( get_orbit_rate() ); } } -- cgit v1.2.3