summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-08-10 08:06:30 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-08-11 15:22:35 +0200
commitb318e82356c185b54ef4cd404704422ea24fa277 (patch)
tree08ef9ba8115ebb97ffebbb035b75e3c3feb42a04 /src/player.h
parent98fa00db12b4658f6bce61f0a2c03c69b963f8f2 (diff)
downloadminetest-b318e82356c185b54ef4cd404704422ea24fa277.tar.gz
minetest-b318e82356c185b54ef4cd404704422ea24fa277.tar.bz2
minetest-b318e82356c185b54ef4cd404704422ea24fa277.zip
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.
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/player.h b/src/player.h
index 00a1d4408..45454e9e1 100644
--- a/src/player.h
+++ b/src/player.h
@@ -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;