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

Fix math for isBlockInSight. Fixes #718 (client-side).

This commit is contained in:
Aaron Suen 2013-05-17 17:10:39 -04:00 committed by PilzAdam
parent fedf644635
commit 1369503aba
2 changed files with 18 additions and 18 deletions

View file

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