diff options
author | Kahrl <kahrl@gmx.net> | 2011-09-08 01:08:47 +0200 |
---|---|---|
committer | Kahrl <kahrl@gmx.net> | 2011-09-08 01:08:47 +0200 |
commit | baf7da9d4a7fc0566840b159903999d76d99a228 (patch) | |
tree | 66ed23105449fcf51e971d5f8fcbf03d04973fb7 /src/map.cpp | |
parent | c0b35fa429c68b49b2d6a5124aff6dcc31400b63 (diff) | |
download | minetest-baf7da9d4a7fc0566840b159903999d76d99a228.tar.gz minetest-baf7da9d4a7fc0566840b159903999d76d99a228.tar.bz2 minetest-baf7da9d4a7fc0566840b159903999d76d99a228.zip |
Collected and moved existing camera infrastructure from game.cpp to camera.cpp and camera.h. Introduced configuration settings 'fov' which chooses the camera's (vertical) field of view and 'view_bobbing' which currently does nothing. Other code refactored to not expect the FOV to be a build time constant.
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/map.cpp b/src/map.cpp index 6f22498fe..b1908fe2e 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3604,7 +3604,8 @@ ClientMap::ClientMap( m_client(client), m_control(control), m_camera_position(0,0,0), - m_camera_direction(0,0,1) + m_camera_direction(0,0,1), + m_camera_fov(M_PI) { m_camera_mutex.Init(); assert(m_camera_mutex.IsInitialized()); @@ -3713,6 +3714,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) m_camera_mutex.Lock(); v3f camera_position = m_camera_position; v3f camera_direction = m_camera_direction; + f32 camera_fov = m_camera_fov; m_camera_mutex.Unlock(); /* @@ -3805,7 +3807,8 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) float d = 0.0; if(isBlockInSight(block->getPos(), camera_position, - camera_direction, range, &d) == false) + camera_direction, camera_fov, + range, &d) == false) { continue; } |