mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02: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:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user