diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2020-04-20 14:27:22 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2020-04-20 14:27:22 +0300 |
commit | 74d6e6b65c9c3e85e8ec84939b35a1e584379e1f (patch) | |
tree | 594978c1282ff02e37525b6f94f310d4299a1583 /indra/newview/llfloatercamera.cpp | |
parent | 70d340a1bff2707138ac41fdd1408a5b2e46fc71 (diff) |
SL-12904 FIXED Camera Preset does not restore correctly when sitting
Diffstat (limited to 'indra/newview/llfloatercamera.cpp')
-rw-r--r-- | indra/newview/llfloatercamera.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index e1e7ee8445..2399e4f495 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -44,6 +44,7 @@ #include "llfirstuse.h" #include "llhints.h" #include "lltabcontainer.h" +#include "llvoavatarself.h" static LLDefaultChildRegistry::Register<LLPanelCameraItem> r("panel_camera_item"); @@ -566,6 +567,19 @@ void LLFloaterCamera::switchToPreset(const std::string& name) LLPresetsManager::getInstance()->loadPreset(PRESETS_CAMERA, name); } + if (isAgentAvatarValid() && gAgentAvatarp->getParent()) + { + LLQuaternion sit_rot = gSavedSettings.getQuaternion("AvatarSitRotation"); + if (sit_rot != LLQuaternion()) + { + gAgent.rotate(~gAgent.getFrameAgent().getQuaternion()); + gAgent.rotate(sit_rot); + } + else + { + gAgentCamera.rotateToInitSitRot(); + } + } gAgentCamera.resetCameraZoomFraction(); LLFloaterCamera* camera_floater = LLFloaterCamera::findInstance(); |