diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llagentcamera.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llagentcamera.h | 3 | ||||
-rw-r--r-- | indra/newview/llfloatercamera.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llfloatersavecamerapreset.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llpresetsmanager.cpp | 3 |
5 files changed, 17 insertions, 6 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index d1da132587..f1d8bf3cf1 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1987,8 +1987,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) LLVector3 LLAgentCamera::getCurrentCameraOffset() { - LLVector3 camera_offset = (LLViewerCamera::getInstance()->getOrigin() - getAvatarRootPosition() - mThirdPersonHeadOffset) * ~getCurrentAvatarRotation(); - return camera_offset / mCameraZoomFraction / gSavedSettings.getF32("CameraOffsetScale"); + return (LLViewerCamera::getInstance()->getOrigin() - getAvatarRootPosition() - mThirdPersonHeadOffset) * ~getCurrentAvatarRotation(); } LLVector3d LLAgentCamera::getCurrentFocusOffset() @@ -2829,6 +2828,11 @@ BOOL LLAgentCamera::setPointAt(EPointAtType target_type, LLViewerObject *object, return mPointAt->setPointAt(target_type, object, position); } +void LLAgentCamera::resetCameraZoomFraction() +{ + mCameraZoomFraction = INITIAL_ZOOM_FRACTION; +} + ELookAtType LLAgentCamera::getLookAtType() { if (mLookAt) diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index 357dd5e12a..420cc0b601 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -282,6 +282,9 @@ public: F32 calcCameraFOVZoomFactor(); F32 getAgentHUDTargetZoom(); + void resetCameraZoomFraction(); + F32 getCurrentCameraZoomFraction() { return mCameraZoomFraction; } + //-------------------------------------------------------------------- // Pan //-------------------------------------------------------------------- diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index cc02862868..e1e7ee8445 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -565,7 +565,8 @@ void LLFloaterCamera::switchToPreset(const std::string& name) { LLPresetsManager::getInstance()->loadPreset(PRESETS_CAMERA, name); } - gAgentCamera.setCameraZoomFraction(gSavedSettings.getF32("CameraZoomFraction")); + + gAgentCamera.resetCameraZoomFraction(); LLFloaterCamera* camera_floater = LLFloaterCamera::findInstance(); if (camera_floater) diff --git a/indra/newview/llfloatersavecamerapreset.cpp b/indra/newview/llfloatersavecamerapreset.cpp index 34aefdf1c1..e2bd2e6d6a 100644 --- a/indra/newview/llfloatersavecamerapreset.cpp +++ b/indra/newview/llfloatersavecamerapreset.cpp @@ -107,6 +107,12 @@ void LLFloaterSaveCameraPreset::onBtnSave() gSavedSettings.setVector3("CameraOffsetRearView", gAgentCamera.getCurrentCameraOffset()); gSavedSettings.setVector3d("FocusOffsetRearView", gAgentCamera.getCurrentFocusOffset()); } + else + { + LLVector3 camera_offset = gSavedSettings.getVector3("CameraOffsetRearView") * gAgentCamera.getCurrentCameraZoomFraction(); + gSavedSettings.setVector3("CameraOffsetRearView", camera_offset); + gAgentCamera.resetCameraZoomFraction(); + } if (is_saving_new) { std::list<std::string> preset_names; diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index fd89a1fcb6..129187ccbd 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -309,9 +309,6 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n name_list.clear(); getControlNames(name_list); name_list.push_back("PresetCameraActive"); - - gSavedSettings.setF32("CameraZoomFraction", gAgentCamera.getCameraZoomFraction(true)); - name_list.push_back("CameraZoomFraction"); } else { |