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

Refactor player's eye position coding

Collect the player's eye position coding in a Player method, and
use it in client to pass the eye position information to the game.
This commit is contained in:
Giuseppe Bilotta 2011-08-10 08:06:30 +02:00
parent 98fa00db12
commit b318e82356
4 changed files with 16 additions and 8 deletions

View file

@ -1935,11 +1935,13 @@ NodeMetadata* Client::getNodeMetadata(v3s16 p)
return m_env.getMap().getNodeMetadata(p);
}
v3f Client::getPlayerPosition()
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();
}