aboutsummaryrefslogtreecommitdiff
path: root/src/camera.cpp
diff options
context:
space:
mode:
authorLars Hofhansl <larsh@apache.org>2017-11-15 21:58:23 -0800
committerLars Hofhansl <larsh@apache.org>2017-11-15 22:03:58 -0800
commitae9b1aa1774aedca8f452514d9462c281e36773a (patch)
treed3d4a8d9b8f5b4209bc10548562dbb88906220a5 /src/camera.cpp
parentee6bb5a315cc13aa51cda509d02780c21333af44 (diff)
downloadminetest-ae9b1aa1774aedca8f452514d9462c281e36773a.tar.gz
minetest-ae9b1aa1774aedca8f452514d9462c281e36773a.tar.bz2
minetest-ae9b1aa1774aedca8f452514d9462c281e36773a.zip
Allow zoom to actually show more data.
This allows the client to retrieve blocks at a greater distance from the server, thus allowing for a real zoom.
Diffstat (limited to 'src/camera.cpp')
-rw-r--r--src/camera.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/camera.cpp b/src/camera.cpp
index e0028f480..62acbe26d 100644
--- a/src/camera.cpp
+++ b/src/camera.cpp
@@ -458,7 +458,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, f32 tool_r
} else {
fov_degrees = m_cache_fov;
}
- fov_degrees = rangelim(fov_degrees, 7.0, 160.0);
+ fov_degrees = rangelim(fov_degrees, 1.0, 160.0);
// FOV and aspect ratio
const v2u32 &window_size = RenderingEngine::get_instance()->getWindowSize();
@@ -550,7 +550,8 @@ void Camera::updateViewingRange()
{
f32 viewing_range = g_settings->getFloat("viewing_range");
f32 near_plane = g_settings->getFloat("near_plane");
- m_draw_control.wanted_range = viewing_range;
+
+ m_draw_control.wanted_range = std::fmin(adjustDist(viewing_range, getFovMax()), 4000);
m_cameranode->setNearValue(rangelim(near_plane, 0.0f, 0.5f) * BS);
if (m_draw_control.range_all) {
m_cameranode->setFarValue(100000.0);