aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-05-27 02:46:02 -0700
committerJacek Antonelli2010-06-19 02:43:02 -0500
commit98a21e2d491fc12808751db7edc960810226bccd (patch)
tree5e73b4525cf0fec1fe324feb9428af9ab77948d3 /linden/indra/newview
parentAdded some debug lines to llviewermessage for animations (diff)
downloadmeta-impy-98a21e2d491fc12808751db7edc960810226bccd.zip
meta-impy-98a21e2d491fc12808751db7edc960810226bccd.tar.gz
meta-impy-98a21e2d491fc12808751db7edc960810226bccd.tar.bz2
meta-impy-98a21e2d491fc12808751db7edc960810226bccd.tar.xz
Added checkbox in Preferences > Input and Camera to disable the minimum zoom in distance (DisableMinZoomDist)
Diffstat (limited to 'linden/indra/newview')
-rw-r--r--linden/indra/newview/app_settings/settings.xml11
-rw-r--r--linden/indra/newview/llagent.cpp43
-rw-r--r--linden/indra/newview/llpanelinput.cpp5
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_input.xml7
4 files changed, 48 insertions, 18 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 670de2b..952efc7 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -70,6 +70,17 @@
70 <key>Value</key> 70 <key>Value</key>
71 <integer>0</integer> 71 <integer>0</integer>
72 </map> 72 </map>
73 <key>DisableMinZoomDist</key>
74 <map>
75 <key>Comment</key>
76 <string>Disable minimum zoom distance limits</string>
77 <key>Persist</key>
78 <integer>1</integer>
79 <key>Type</key>
80 <string>Boolean</string>
81 <key>Value</key>
82 <integer>0</integer>
83 </map>
73 <key>DisableTeleportScreens</key> 84 <key>DisableTeleportScreens</key>
74 <map> 85 <map>
75 <key>Comment</key> 86 <key>Comment</key>
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index 4753bc8..e2be0d0 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -1780,12 +1780,12 @@ void LLAgent::setCameraZoomFraction(F32 fraction)
1780 // 0.f -> camera zoomed all the way out 1780 // 0.f -> camera zoomed all the way out
1781 // 1.f -> camera zoomed all the way in 1781 // 1.f -> camera zoomed all the way in
1782 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); 1782 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
1783 1783 BOOL disable_min = gSavedSettings.getBOOL("DisableMinZoomDist");
1784 if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) 1784 if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD)
1785 { 1785 {
1786 mHUDTargetZoom = fraction; 1786 mHUDTargetZoom = fraction;
1787 } 1787 }
1788 else if (mFocusOnAvatar && cameraThirdPerson()) 1788 else if (mFocusOnAvatar && cameraThirdPerson() && !disable_min)
1789 { 1789 {
1790 mCameraZoomFraction = rescale(fraction, 0.f, 1.f, MAX_ZOOM_FRACTION, MIN_ZOOM_FRACTION); 1790 mCameraZoomFraction = rescale(fraction, 0.f, 1.f, MAX_ZOOM_FRACTION, MIN_ZOOM_FRACTION);
1791 } 1791 }
@@ -1802,7 +1802,7 @@ void LLAgent::setCameraZoomFraction(F32 fraction)
1802 LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE, 1802 LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE,
1803 MAX_CAMERA_DISTANCE_FROM_AGENT); 1803 MAX_CAMERA_DISTANCE_FROM_AGENT);
1804 1804
1805 if (mFocusObject.notNull()) 1805 if (!disable_min)
1806 { 1806 {
1807 if (mFocusObject.notNull()) 1807 if (mFocusObject.notNull())
1808 { 1808 {
@@ -1816,6 +1816,10 @@ void LLAgent::setCameraZoomFraction(F32 fraction)
1816 } 1816 }
1817 } 1817 }
1818 } 1818 }
1819 else
1820 {
1821 min_zoom = 0.f;
1822 }
1819 1823
1820 LLVector3d camera_offset_dir = mCameraFocusOffsetTarget; 1824 LLVector3d camera_offset_dir = mCameraFocusOffsetTarget;
1821 camera_offset_dir.normalize(); 1825 camera_offset_dir.normalize();
@@ -1906,30 +1910,34 @@ void LLAgent::cameraZoomIn(const F32 fraction)
1906 1910
1907 LLVector3d camera_offset(mCameraFocusOffsetTarget); 1911 LLVector3d camera_offset(mCameraFocusOffsetTarget);
1908 LLVector3d camera_offset_unit(mCameraFocusOffsetTarget); 1912 LLVector3d camera_offset_unit(mCameraFocusOffsetTarget);
1909 F32 min_zoom = LAND_MIN_ZOOM; 1913 F32 min_zoom = 0.f;//LAND_MIN_ZOOM;
1910 F32 current_distance = (F32)camera_offset_unit.normalize(); 1914 F32 current_distance = (F32)camera_offset_unit.normalize();
1911 F32 new_distance = current_distance * fraction; 1915 F32 new_distance = current_distance * fraction;
1912 1916
1913 // Don't move through focus point 1917 // Don't move through focus point
1914 if (mFocusObject) 1918
1919 if (!gSavedSettings.getBOOL("DisableMinZoomDist"))
1915 { 1920 {
1916 LLVector3 camera_offset_dir((F32)camera_offset_unit.mdV[VX], (F32)camera_offset_unit.mdV[VY], (F32)camera_offset_unit.mdV[VZ]); 1921 if (mFocusObject)
1917
1918 if (mFocusObject->isAvatar())
1919 {
1920 calcCameraMinDistance(min_zoom);
1921 }
1922 else
1923 { 1922 {
1924 min_zoom = OBJECT_MIN_ZOOM; 1923 LLVector3 camera_offset_dir((F32)camera_offset_unit.mdV[VX], (F32)camera_offset_unit.mdV[VY], (F32)camera_offset_unit.mdV[VZ]);
1924 if (mFocusObject->isAvatar())
1925 {
1926 calcCameraMinDistance(min_zoom);
1927 }
1928 else
1929 {
1930 min_zoom = OBJECT_MIN_ZOOM;
1931 }
1925 } 1932 }
1933 new_distance = llmax(new_distance, min_zoom);
1926 } 1934 }
1927 1935
1928 // Don't zoom too far back 1936 // Don't zoom too far back
1929 // Actually, let's when disable camera constraints is active -- McCabe 1937 // Actually, let's when disable camera constraints is active -- McCabe
1930 if (!gSavedSettings.getBOOL("DisableCameraConstraints")) 1938 if (!gSavedSettings.getBOOL("DisableCameraConstraints"))
1931 { 1939 {
1932 new_distance = llmax(new_distance, min_zoom); 1940 //new_distance = llmax(new_distance, min_zoom);
1933 1941
1934 F32 max_distance = llmin(mDrawDistance - DIST_FUDGE, 1942 F32 max_distance = llmin(mDrawDistance - DIST_FUDGE,
1935 LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE ); 1943 LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE );
@@ -1947,7 +1955,7 @@ void LLAgent::cameraZoomIn(const F32 fraction)
1947 */ 1955 */
1948 } 1956 }
1949 1957
1950 if( cameraCustomizeAvatar() ) 1958 if( cameraCustomizeAvatar() && !gSavedSettings.getBOOL("DisableMinZoomDist"))
1951 { 1959 {
1952 new_distance = llclamp( new_distance, APPEARANCE_MIN_ZOOM, APPEARANCE_MAX_ZOOM ); 1960 new_distance = llclamp( new_distance, APPEARANCE_MIN_ZOOM, APPEARANCE_MAX_ZOOM );
1953 } 1961 }
@@ -3679,7 +3687,8 @@ F32 LLAgent::calcCameraFOVZoomFactor()
3679 // don't FOV zoom on mostly transparent objects 3687 // don't FOV zoom on mostly transparent objects
3680 LLVector3 focus_offset = mFocusObjectOffset; 3688 LLVector3 focus_offset = mFocusObjectOffset;
3681 F32 obj_min_dist = 0.f; 3689 F32 obj_min_dist = 0.f;
3682 calcCameraMinDistance(obj_min_dist); 3690 if (!gSavedSettings.getBOOL("DisableMinZoomDist"))
3691 calcCameraMinDistance(obj_min_dist);
3683 F32 current_distance = llmax(0.001f, camera_offset_dir.magVec()); 3692 F32 current_distance = llmax(0.001f, camera_offset_dir.magVec());
3684 3693
3685 mFocusObjectDist = obj_min_dist - current_distance; 3694 mFocusObjectDist = obj_min_dist - current_distance;
@@ -3825,7 +3834,7 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit)
3825 camera_distance = local_camera_offset.normalize(); 3834 camera_distance = local_camera_offset.normalize();
3826 } 3835 }
3827 3836
3828 mTargetCameraDistance = llmax(camera_distance, MIN_CAMERA_DISTANCE); 3837 mTargetCameraDistance = (gSavedSettings.getBOOL("DisableMinZoomDist")) ? camera_distance : llmax(camera_distance, MIN_CAMERA_DISTANCE);
3829 3838
3830 if (mTargetCameraDistance != mCurrentCameraDistance) 3839 if (mTargetCameraDistance != mCurrentCameraDistance)
3831 { 3840 {
diff --git a/linden/indra/newview/llpanelinput.cpp b/linden/indra/newview/llpanelinput.cpp
index d530d67..32c4af3 100644
--- a/linden/indra/newview/llpanelinput.cpp
+++ b/linden/indra/newview/llpanelinput.cpp
@@ -77,6 +77,9 @@ BOOL LLPanelInput::postBuild()
77 childSetValue("double_click_action", gSavedSettings.getString("DoubleClickAction")); 77 childSetValue("double_click_action", gSavedSettings.getString("DoubleClickAction"));
78 childSetValue("go_action", gSavedSettings.getString("GoAction")); 78 childSetValue("go_action", gSavedSettings.getString("GoAction"));
79 79
80 childSetValue("Disable camera constraints", gSavedSettings.getBOOL("DisableCameraConstraints"));
81 childSetValue("disable_min_zoom_check", gSavedSettings.getBOOL("DisableMinZoomDist"));
82
80 return TRUE; 83 return TRUE;
81} 84}
82 85
@@ -104,6 +107,8 @@ void LLPanelInput::apply()
104 gSavedSettings.setString("DoubleClickAction", childGetValue("double_click_action")); 107 gSavedSettings.setString("DoubleClickAction", childGetValue("double_click_action"));
105 gSavedSettings.setString("GoAction", childGetValue("go_action")); 108 gSavedSettings.setString("GoAction", childGetValue("go_action"));
106 109
110 gSavedSettings.setBOOL("DisableCameraConstraints", childGetValue("Disable camera constraints"));
111 gSavedSettings.setBOOL("DisableMinZoomDist", childGetValue("disable_min_zoom_check"));
107} 112}
108 113
109void LLPanelInput::cancel() 114void LLPanelInput::cancel()
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_input.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_input.xml
index fa4f3a5..7a5f22d 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_input.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_input.xml
@@ -89,11 +89,16 @@
89 label="Automatic Appearance Camera Movement" left="148" mouse_opaque="true" 89 label="Automatic Appearance Camera Movement" left="148" mouse_opaque="true"
90 name="appearance_camera_movement" radio_style="false" 90 name="appearance_camera_movement" radio_style="false"
91 tool_tip="Use automatic camera positioning while in edit mode" width="242" /> 91 tool_tip="Use automatic camera positioning while in edit mode" width="242" />
92 <check_box bottom_delta="-18" control_name="DisableCameraConstraints" enabled="true" 92 <check_box bottom_delta="-18" enabled="true"
93 follows="left|top" font="SansSerifSmall" height="16" initial_value="false" 93 follows="left|top" font="SansSerifSmall" height="16" initial_value="false"
94 label="Disable camera constraints" left="148" mouse_opaque="true" 94 label="Disable camera constraints" left="148" mouse_opaque="true"
95 name="Disable camera constraints" radio_style="false" 95 name="Disable camera constraints" radio_style="false"
96 tool_tip="Disables camera limits such as distance and terrain" width="242" /> 96 tool_tip="Disables camera limits such as distance and terrain" width="242" />
97 <check_box bottom_delta="-18" enabled="true"
98 follows="left|top" font="SansSerifSmall" height="16" initial_value="false"
99 label="Disable minimum zoom distance" left="168" mouse_opaque="true"
100 name="disable_min_zoom_check" radio_style="false"
101 tool_tip="Disables minimum zoom distance for prims and avatars" width="242" />
97 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 102 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
98 bottom_delta="-32" drop_shadow_visible="true" enabled="true" follows="left|top" 103 bottom_delta="-32" drop_shadow_visible="true" enabled="true" follows="left|top"
99 font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10" 104 font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10"