1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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.
This commit is contained in:
Lars Hofhansl 2017-11-15 21:58:23 -08:00
parent ee6bb5a315
commit ae9b1aa177
4 changed files with 33 additions and 15 deletions

View file

@ -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);