aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-05-14 21:16:45 +0200
committerGitHub <noreply@github.com>2020-05-14 21:16:45 +0200
commit36d35f2fe31a429c1510df680801940472416d45 (patch)
treef36be46515b7631ccbc581451c134e8d9c9a9265 /src/client
parent6ef7ad09bbed9176d0d15f53b5cb14ef6e18a3b2 (diff)
downloadminetest-36d35f2fe31a429c1510df680801940472416d45.tar.gz
minetest-36d35f2fe31a429c1510df680801940472416d45.tar.bz2
minetest-36d35f2fe31a429c1510df680801940472416d45.zip
CSM: Bugfixes to camera:get_pos() and camera:get_fov()
closes #9857
Diffstat (limited to 'src/client')
-rw-r--r--src/client/camera.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/camera.cpp b/src/client/camera.cpp
index 1a5253db4..9b311171a 100644
--- a/src/client/camera.cpp
+++ b/src/client/camera.cpp
@@ -540,7 +540,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime, f32 tool_r
m_aspect = (f32) window_size.X / (f32) window_size.Y;
m_fov_y = m_curr_fov_degrees * M_PI / 180.0;
// Increase vertical FOV on lower aspect ratios (<16:10)
- m_fov_y *= MYMAX(1.0, MYMIN(1.4, sqrt(16./10. / m_aspect)));
+ m_fov_y *= core::clamp(sqrt(16./10. / m_aspect), 1.0, 1.4);
m_fov_x = 2 * atan(m_aspect * tan(0.5 * m_fov_y));
m_cameranode->setAspectRatio(m_aspect);
m_cameranode->setFOV(m_fov_y);