aboutsummaryrefslogtreecommitdiff
path: root/src/camera.cpp
diff options
context:
space:
mode:
authorAaron Suen <warr1024@gmail.com>2013-05-17 17:10:39 -0400
committerPilzAdam <pilzadam@minetest.net>2013-05-18 00:13:01 +0200
commit1369503aba1ae0c64e6c25b32cc5552bbdead8fb (patch)
tree9936bfe918a2254481c541e7227b615ac87589f4 /src/camera.cpp
parentfedf644635456b85d6168ca98f6dc712b1ce7f2e (diff)
downloadminetest-1369503aba1ae0c64e6c25b32cc5552bbdead8fb.tar.gz
minetest-1369503aba1ae0c64e6c25b32cc5552bbdead8fb.tar.bz2
minetest-1369503aba1ae0c64e6c25b32cc5552bbdead8fb.zip
Fix math for isBlockInSight. Fixes #718 (client-side).
Diffstat (limited to 'src/camera.cpp')
-rw-r--r--src/camera.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/camera.cpp b/src/camera.cpp
index 6224a2b8e..0dd0a767b 100644
--- a/src/camera.cpp
+++ b/src/camera.cpp
@@ -342,8 +342,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, v2u32 screensize,
m_fov_y = 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)));
- // WTF is this? It can't be right
- m_fov_x = 2 * atan(0.5 * m_aspect * tan(m_fov_y));
+ m_fov_x = 2 * atan(m_aspect * tan(0.5 * m_fov_y));
m_cameranode->setAspectRatio(m_aspect);
m_cameranode->setFOV(m_fov_y);