mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +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:
parent
98fa00db12
commit
b318e82356
4 changed files with 16 additions and 8 deletions
|
@ -67,6 +67,14 @@ public:
|
|||
return floatToInt(m_position + v3f(0,BS+BS/2,0), BS);
|
||||
}
|
||||
|
||||
v3f getEyePosition()
|
||||
{
|
||||
// This is at the height of the eyes of the current figure
|
||||
// return m_position + v3f(0, BS+BS/2, 0);
|
||||
// This is more like in minecraft
|
||||
return m_position + v3f(0,BS+(5*BS)/8,0);
|
||||
}
|
||||
|
||||
virtual void setPosition(const v3f &position)
|
||||
{
|
||||
m_position = position;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue