projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ff9497
)
Increase vertical FOV on lower aspect ratios (<16:10)
author
Perttu Ahola
<celeron55@gmail.com>
Tue, 27 Mar 2012 15:39:21 +0000
(18:39 +0300)
committer
Perttu Ahola
<celeron55@gmail.com>
Tue, 27 Mar 2012 15:39:21 +0000
(18:39 +0300)
src/camera.cpp
patch
|
blob
|
history
diff --git
a/src/camera.cpp
b/src/camera.cpp
index 0148298cb627c22bcfd87522cbeb46b99b6e60da..ba05329e58c651be2b88196abf766c067761d15a 100644
(file)
--- a/
src/camera.cpp
+++ b/
src/camera.cpp
@@
-290,6
+290,9
@@
void Camera::update(LocalPlayer* player, f32 frametime, v2u32 screensize,
// FOV and aspect ratio
m_aspect = (f32)screensize.X / (f32) screensize.Y;
m_fov_y = fov_degrees * 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_cameranode->setAspectRatio(m_aspect);
m_cameranode->setFOV(m_fov_y);