summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2016-02-14 17:45:06 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2016-02-14 17:52:10 +0100
commit3a74b84007f2c0f0690524459cc935616f8805d2 (patch)
tree2f2a8072fde9f3b451eaa2e2ccf3d42c6b475822 /src/player.cpp
parentcfc8e447595db0351754a2eae29a18918742d29d (diff)
downloadminetest-3a74b84007f2c0f0690524459cc935616f8805d2.tar.gz
minetest-3a74b84007f2c0f0690524459cc935616f8805d2.tar.bz2
minetest-3a74b84007f2c0f0690524459cc935616f8805d2.zip
Player::accelerateHorizontal/Vertical should be member of LocalPlayer
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/player.cpp b/src/player.cpp
index dd5e04509..623dde230 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -111,41 +111,6 @@ Player::~Player()
clearHud();
}
-// Horizontal acceleration (X and Z), Y direction is ignored
-void Player::accelerateHorizontal(v3f target_speed, f32 max_increase)
-{
- if(max_increase == 0)
- return;
-
- v3f d_wanted = target_speed - m_speed;
- d_wanted.Y = 0;
- f32 dl = d_wanted.getLength();
- if(dl > max_increase)
- dl = max_increase;
-
- v3f d = d_wanted.normalize() * dl;
-
- m_speed.X += d.X;
- m_speed.Z += d.Z;
-
-}
-
-// Vertical acceleration (Y), X and Z directions are ignored
-void Player::accelerateVertical(v3f target_speed, f32 max_increase)
-{
- if(max_increase == 0)
- return;
-
- f32 d_wanted = target_speed.Y - m_speed.Y;
- if(d_wanted > max_increase)
- d_wanted = max_increase;
- else if(d_wanted < -max_increase)
- d_wanted = -max_increase;
-
- m_speed.Y += d_wanted;
-
-}
-
v3s16 Player::getLightPosition() const
{
return floatToInt(m_position + v3f(0,BS+BS/2,0), BS);