diff options
author | McCabe Maxsted | 2009-10-10 10:36:51 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-10-10 10:36:51 -0700 |
commit | 91b0db9bb43d9fe89b287a9ff308913abc0f2a81 (patch) | |
tree | e0f85c8e308dd8d00503f88194fc7fcf4664124c /linden/indra/newview/llagent.cpp | |
parent | Merge branch '1.2.0-cameraconstraints' into 1.2.0-cameraconstraints2 (diff) | |
download | meta-impy-91b0db9bb43d9fe89b287a9ff308913abc0f2a81.zip meta-impy-91b0db9bb43d9fe89b287a9ff308913abc0f2a81.tar.gz meta-impy-91b0db9bb43d9fe89b287a9ff308913abc0f2a81.tar.bz2 meta-impy-91b0db9bb43d9fe89b287a9ff308913abc0f2a81.tar.xz |
cleaned up disablecameraconstraints min zoom change
Diffstat (limited to 'linden/indra/newview/llagent.cpp')
-rw-r--r-- | linden/indra/newview/llagent.cpp | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index 08fd35d..022e1cc 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp | |||
@@ -188,7 +188,6 @@ const F32 APPEARANCE_MIN_ZOOM = 0.39f; | |||
188 | const F32 APPEARANCE_MAX_ZOOM = 8.f; | 188 | const F32 APPEARANCE_MAX_ZOOM = 8.f; |
189 | 189 | ||
190 | const F32 DIST_FUDGE = 16.f; // meters | 190 | const F32 DIST_FUDGE = 16.f; // meters |
191 | const F32 MAX_CAMERA_DIST_NO_CONSTRANT = 65535.f*4.f; | ||
192 | 191 | ||
193 | // fidget constants | 192 | // fidget constants |
194 | const F32 MIN_FIDGET_TIME = 8.f; // seconds | 193 | const F32 MIN_FIDGET_TIME = 8.f; // seconds |
@@ -1719,6 +1718,10 @@ F32 LLAgent::getCameraZoomFraction() | |||
1719 | // already [0,1] | 1718 | // already [0,1] |
1720 | return mHUDTargetZoom; | 1719 | return mHUDTargetZoom; |
1721 | } | 1720 | } |
1721 | else if (gSavedSettings.getBOOL("DisableCameraConstraints")) | ||
1722 | { | ||
1723 | return mCameraZoomFraction; | ||
1724 | } | ||
1722 | else if (mFocusOnAvatar && cameraThirdPerson()) | 1725 | else if (mFocusOnAvatar && cameraThirdPerson()) |
1723 | { | 1726 | { |
1724 | return clamp_rescale(mCameraZoomFraction, MIN_ZOOM_FRACTION, MAX_ZOOM_FRACTION, 1.f, 0.f); | 1727 | return clamp_rescale(mCameraZoomFraction, MIN_ZOOM_FRACTION, MAX_ZOOM_FRACTION, 1.f, 0.f); |
@@ -1731,17 +1734,9 @@ F32 LLAgent::getCameraZoomFraction() | |||
1731 | else | 1734 | else |
1732 | { | 1735 | { |
1733 | F32 min_zoom; | 1736 | F32 min_zoom; |
1734 | F32 max_zoom; | 1737 | F32 max_zoom = llmin(mDrawDistance - DIST_FUDGE, |
1735 | if (gSavedSettings.getBOOL("DisableCameraConstraints")) | ||
1736 | { | ||
1737 | max_zoom = MAX_CAMERA_DIST_NO_CONSTRANT; | ||
1738 | } | ||
1739 | else | ||
1740 | { | ||
1741 | max_zoom = llmin(mDrawDistance - DIST_FUDGE, | ||
1742 | LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE, | 1738 | LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE, |
1743 | MAX_CAMERA_DISTANCE_FROM_AGENT); | 1739 | MAX_CAMERA_DISTANCE_FROM_AGENT); |
1744 | } | ||
1745 | 1740 | ||
1746 | F32 distance = (F32)mCameraFocusOffsetTarget.magVec(); | 1741 | F32 distance = (F32)mCameraFocusOffsetTarget.magVec(); |
1747 | if (mFocusObject.notNull()) | 1742 | if (mFocusObject.notNull()) |
@@ -1787,17 +1782,9 @@ void LLAgent::setCameraZoomFraction(F32 fraction) | |||
1787 | else | 1782 | else |
1788 | { | 1783 | { |
1789 | F32 min_zoom = LAND_MIN_ZOOM; | 1784 | F32 min_zoom = LAND_MIN_ZOOM; |
1790 | F32 max_zoom; | 1785 | F32 max_zoom = llmin(mDrawDistance - DIST_FUDGE, |
1791 | if (gSavedSettings.getBOOL("DisableCameraConstraints")) | 1786 | LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE, |
1792 | { | 1787 | MAX_CAMERA_DISTANCE_FROM_AGENT); |
1793 | max_zoom = MAX_CAMERA_DIST_NO_CONSTRANT; | ||
1794 | } | ||
1795 | else | ||
1796 | { | ||
1797 | max_zoom = llmin(mDrawDistance - DIST_FUDGE, | ||
1798 | LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE, | ||
1799 | MAX_CAMERA_DISTANCE_FROM_AGENT); | ||
1800 | } | ||
1801 | 1788 | ||
1802 | if (mFocusObject.notNull()) | 1789 | if (mFocusObject.notNull()) |
1803 | { | 1790 | { |
@@ -1816,7 +1803,14 @@ void LLAgent::setCameraZoomFraction(F32 fraction) | |||
1816 | 1803 | ||
1817 | LLVector3d camera_offset_dir = mCameraFocusOffsetTarget; | 1804 | LLVector3d camera_offset_dir = mCameraFocusOffsetTarget; |
1818 | camera_offset_dir.normalize(); | 1805 | camera_offset_dir.normalize(); |
1819 | mCameraFocusOffsetTarget = camera_offset_dir * rescale(fraction, 0.f, 1.f, max_zoom, min_zoom); | 1806 | if (gSavedSettings.getBOOL("DisableCameraConstraints")) |
1807 | { | ||
1808 | mCameraFocusOffsetTarget = camera_offset_dir * rescale(fraction, 0.f, 262140.f, 1.f, min_zoom); | ||
1809 | } | ||
1810 | else | ||
1811 | { | ||
1812 | mCameraFocusOffsetTarget = camera_offset_dir * rescale(fraction, 0.f, 1.f, max_zoom, min_zoom); | ||
1813 | } | ||
1820 | } | 1814 | } |
1821 | startCameraAnimation(); | 1815 | startCameraAnimation(); |
1822 | } | 1816 | } |