diff --git a/indra/newview/app_settings/settings_alchemy.xml b/indra/newview/app_settings/settings_alchemy.xml index ea2c30b2cdf1df479439b94a7776fef79bd7a442..ef1d921083a9594da8e5b4362ee00d2521aeb8ab 100644 --- a/indra/newview/app_settings/settings_alchemy.xml +++ b/indra/newview/app_settings/settings_alchemy.xml @@ -13,6 +13,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>AlchemyCameraNoZoomLimit</key> + <map> + <key>Comment</key> + <string>Disables the minimum zoom distance, allowing more camera freedom</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>AlchemyChatCommandAnimationOverride</key> <map> <key>Comment</key> diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 3af05684363f75f6675ee485ded37c8bc66986b2..646a91e3669129c1eb0cef9bb14ea23541f05caa 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -958,23 +958,27 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction) F32 current_distance = (F32)camera_offset_unit.normalize(); F32 new_distance = current_distance * fraction; - // Don't move through focus point - if (mFocusObject) + static LLCachedControl<bool> disable_camera_limits(gSavedSettings, "AlchemyCameraNoZoomLimit", false); + if (!disable_camera_limits) { - LLVector3 camera_offset_dir((F32)camera_offset_unit.mdV[VX], (F32)camera_offset_unit.mdV[VY], (F32)camera_offset_unit.mdV[VZ]); - - if (mFocusObject->isAvatar()) - { - calcCameraMinDistance(min_zoom); - } - else + // Don't move through focus point + if (mFocusObject) { - min_zoom = OBJECT_MIN_ZOOM; + LLVector3 camera_offset_dir((F32)camera_offset_unit.mdV[VX], (F32)camera_offset_unit.mdV[VY], (F32)camera_offset_unit.mdV[VZ]); + + if (mFocusObject->isAvatar()) + { + calcCameraMinDistance(min_zoom); + } + else + { + min_zoom = OBJECT_MIN_ZOOM; + } } + + new_distance = llmax(new_distance, min_zoom); } - new_distance = llmax(new_distance, min_zoom); - F32 max_distance = getCameraMaxZoomDistance(true); max_distance = llmin(max_distance, current_distance * 4.f); //Scaled max relative to current distance. MAINT-3154 @@ -1032,22 +1036,27 @@ void LLAgentCamera::cameraOrbitIn(const F32 meters) LLVector3d camera_offset_unit(mCameraFocusOffsetTarget); F32 current_distance = (F32)camera_offset_unit.normalize(); F32 new_distance = current_distance - meters; - F32 min_zoom = LAND_MIN_ZOOM; - // Don't move through focus point - if (mFocusObject.notNull()) + static LLCachedControl<bool> disable_camera_limits(gSavedSettings, "AlchemyCameraNoZoomLimit", false); + if (!disable_camera_limits) { - if (mFocusObject->isAvatar()) - { - min_zoom = AVATAR_MIN_ZOOM; - } - else + F32 min_zoom = LAND_MIN_ZOOM; + + // Don't move through focus point + if (mFocusObject.notNull()) { - min_zoom = OBJECT_MIN_ZOOM; + if (mFocusObject->isAvatar()) + { + min_zoom = AVATAR_MIN_ZOOM; + } + else + { + min_zoom = OBJECT_MIN_ZOOM; + } } - } - new_distance = llmax(new_distance, min_zoom); + new_distance = llmax(new_distance, min_zoom); + } F32 max_distance = getCameraMaxZoomDistance(true); @@ -1794,7 +1803,11 @@ F32 LLAgentCamera::calcCameraFOVZoomFactor() { // don't FOV zoom on mostly transparent objects F32 obj_min_dist = 0.f; - calcCameraMinDistance(obj_min_dist); + static LLCachedControl<bool> disable_camera_limits(gSavedSettings, "AlchemyCameraNoZoomLimit", false); + if (!disable_camera_limits) + { + calcCameraMinDistance(obj_min_dist); + } F32 current_distance = llmax(0.001f, camera_offset_dir.magVec()); mFocusObjectDist = obj_min_dist - current_distance; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 85171275db14f040f51dbac402bb5ef157d62deb..598fef6d46f4a00a8b75904a77a5b717416bc676 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2074,6 +2074,16 @@ function="World.EnvPreset" function="ToggleControl" parameter="DisableCameraConstraints" /> </menu_item_check> + <menu_item_check + label="Disable Minimum Zoom Distance" + name="Disable Minimum Zoom Distance"> + <menu_item_check.on_check + function="CheckControl" + parameter="AlchemyCameraNoZoomLimit" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="AlchemyCameraNoZoomLimit" /> + </menu_item_check> <menu_item_separator/>