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

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.

This commit is contained in:
Kahrl 2011-09-08 01:08:47 +02:00
parent c0b35fa429
commit baf7da9d4a
13 changed files with 428 additions and 209 deletions

View file

@ -1978,9 +1978,9 @@ void Client::addNode(v3s16 p, MapNode n)
}
}
void Client::updateCamera(v3f pos, v3f dir)
void Client::updateCamera(v3f pos, v3f dir, f32 fov)
{
m_env.getClientMap().updateCamera(pos, dir);
m_env.getClientMap().updateCamera(pos, dir, fov);
}
void Client::renderPostFx()
@ -2004,16 +2004,6 @@ LocalPlayer* Client::getLocalPlayer()
return m_env.getLocalPlayer();
}
v3f Client::getPlayerPosition(v3f *eye_position)
{
//JMutexAutoLock envlock(m_env_mutex); //bulk comment-out
LocalPlayer *player = m_env.getLocalPlayer();
assert(player != NULL);
if (eye_position)
*eye_position = player->getEyePosition();
return player->getPosition();
}
void Client::setPlayerControl(PlayerControl &control)
{
//JMutexAutoLock envlock(m_env_mutex); //bulk comment-out