summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorNer'zhul <nerzhul@users.noreply.github.com>2016-10-30 14:53:26 +0100
committerGitHub <noreply@github.com>2016-10-30 14:53:26 +0100
commit9d25242c5c1411d692254cf910345d51c9a24fa3 (patch)
treeedec8475b32562379d463757e77031bdc994e971 /src/player.h
parentd43326021a9a7def27773ed1f7ec01992ed3abf6 (diff)
downloadminetest-9d25242c5c1411d692254cf910345d51c9a24fa3.tar.gz
minetest-9d25242c5c1411d692254cf910345d51c9a24fa3.tar.bz2
minetest-9d25242c5c1411d692254cf910345d51c9a24fa3.zip
PlayerSAO/LocalPlayer refactor: (#4612)
* Create UnitSAO, a common part between PlayerSAO & LuaEntitySAO * Move breath to PlayerSAO & LocalPlayer * Migrate m_yaw from (Remote)Player & LuaEntitySAO to UnitSAO * Migrate m_yaw from Player to LocalPlayer for client * Move some functions outside of player class to PlayerSAO/RemotePlayer or LocalPlayer depending on which class needs it * Move pitch to LocalPlayer & PlayerSAO * Move m_position from Player to LocalPlayer * Move camera_barely_in_ceiling to LocalPlayer as it's used only there * use PlayerSAO::m_base_position for Server side positions * remove a unused variable * ServerActiveObject::setPos now uses const ref * use ServerEnv::loadPlayer unconditionnaly as it creates RemotePlayer only if it's not already loaded * Move hp from Player to LocalPlayer * Move m_hp from LuaEntitySAO to UnitSAO * Use m_hp from PlayerSAO/UnitSAO instead of RemotePlayer
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/player.h b/src/player.h
index 6ac5dfe65..5f9bb7ec9 100644
--- a/src/player.h
+++ b/src/player.h
@@ -129,49 +129,7 @@ public:
m_speed = speed;
}
- v3f getPosition()
- {
- return m_position;
- }
-
- v3s16 getLightPosition() const;
-
- v3f getEyeOffset()
- {
- float eye_height = camera_barely_in_ceiling ? 1.5f : 1.625f;
- return v3f(0, BS * eye_height, 0);
- }
-
- v3f getEyePosition()
- {
- return m_position + getEyeOffset();
- }
-
- virtual void setPosition(const v3f &position)
- {
- m_position = position;
- }
-
- virtual void setPitch(f32 pitch)
- {
- m_pitch = pitch;
- }
-
- virtual void setYaw(f32 yaw)
- {
- m_yaw = yaw;
- }
-
- f32 getPitch() const { return m_pitch; }
- f32 getYaw() const { return m_yaw; }
- u16 getBreath() const { return m_breath; }
-
- virtual void setBreath(u16 breath) { m_breath = breath; }
-
- f32 getRadPitch() const { return m_pitch * core::DEGTORAD; }
- f32 getRadYaw() const { return m_yaw * core::DEGTORAD; }
const char *getName() const { return m_name; }
- aabb3f getCollisionbox() const { return m_collisionbox; }
u32 getFreeHudID()
{
@@ -183,7 +141,6 @@ public:
return size;
}
- bool camera_barely_in_ceiling;
v3f eye_offset_first;
v3f eye_offset_third;
@@ -205,8 +162,6 @@ public:
v2s32 local_animations[4];
float local_animation_speed;
- u16 hp;
-
u16 peer_id;
std::string inventory_formspec;
@@ -225,12 +180,7 @@ public:
s32 hud_hotbar_itemcount;
protected:
char m_name[PLAYERNAME_SIZE];
- u16 m_breath;
- f32 m_pitch;
- f32 m_yaw;
v3f m_speed;
- v3f m_position;
- aabb3f m_collisionbox;
std::vector<HudElement *> hud;
private: