16#define PLAYERNAME_SIZE 20
18#define PLAYERNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
19#define PLAYERNAME_ALLOWED_CHARS_USER_EXPL "'a' to 'z', 'A' to 'Z', '0' to '9', '-', '_'"
41 return !(*
this == other);
50 bool a_up,
bool a_down,
bool a_left,
bool a_right,
51 bool a_jump,
bool a_aux1,
bool a_sneak,
53 bool a_dig,
bool a_place,
54 float a_pitch,
float a_yaw,
55 float a_movement_speed,
float a_movement_direction
61 ((a_left&1) << 2) | ((a_right&1) << 3);
125 return !(*
this == other);
146 std::vector<CollisionInfo> *collision_info)
162 size_t size =
hud.size();
163 for (
size_t i = 0; i != size; i++) {
219 void hudApply(std::function<
void(
const std::vector<HudElement*>&)> f);
236 std::vector<HudElement *>
hud;
Definition environment.h:34
Definition inventory.h:314
PlayerControl control
Definition player.h:195
u16 getWieldIndex()
Definition player.cpp:82
void hudApply(std::function< void(const std::vector< HudElement * > &)> f)
Definition player.cpp:128
f32 movement_liquid_fluidity
Definition player.h:184
u16 m_wield_index
Definition player.h:233
Player(const std::string &name, IItemDefManager *idef)
Definition player.cpp:24
std::vector< HudElement * > hud
Definition player.h:236
virtual ~Player()=0
Definition player.cpp:71
u32 addHud(HudElement *hud)
Definition player.cpp:104
DISABLE_CLASS_COPY(Player)
std::string inventory_formspec
Definition player.h:192
f32 movement_acceleration_air
Definition player.h:177
f32 movement_speed_crouch
Definition player.h:180
const std::string & getName() const
Definition player.h:158
f32 movement_acceleration_fast
Definition player.h:178
v2f local_animations[4]
Definition player.h:189
virtual void move(f32 dtime, Environment *env, f32 pos_max_d, std::vector< CollisionInfo > *collision_info)
Definition player.h:145
ItemStack & getWieldedItem(ItemStack *selected, ItemStack *hand) const
Definition player.cpp:87
std::mutex m_mutex
Definition player.h:243
v3f m_speed
Definition player.h:232
void setWieldIndex(u16 index)
Definition player.cpp:76
void clearHud()
Definition player.cpp:146
u32 getFreeHudID()
Definition player.h:160
virtual void move(f32 dtime, Environment *env, f32 pos_max_d)
Definition player.h:143
s32 hud_hotbar_itemcount
Definition player.h:225
f32 movement_speed_jump
Definition player.h:183
HudElement * getHud(u32 id)
Definition player.cpp:118
bool setFov(const PlayerFovSpec &spec)
Definition player.h:205
u16 getMaxHotbarItemcount()
Definition player.cpp:156
PlayerFovSpec m_fov_override_spec
Definition player.h:234
std::string formspec_prepend
Definition player.h:193
v3f eye_offset_third
Definition player.h:171
v3f eye_offset_first
Definition player.h:170
u32 hud_flags
Definition player.h:224
const PlayerFovSpec & getFov() const
Definition player.h:213
Inventory inventory
Definition player.h:174
f32 movement_speed_climb
Definition player.h:182
HudElement * removeHud(u32 id)
Definition player.cpp:134
PlayerPhysicsOverride physics_override
Definition player.h:198
const PlayerControl & getPlayerControl()
Definition player.h:196
float local_animation_speed
Definition player.h:190
v3f eye_offset_third_front
Definition player.h:172
std::string m_name
Definition player.h:231
f32 movement_speed_fast
Definition player.h:181
f32 movement_acceleration_default
Definition player.h:176
v3f getSpeed() const
Definition player.h:156
f32 movement_liquid_fluidity_smooth
Definition player.h:185
f32 movement_gravity
Definition player.h:187
void setSpeed(v3f speed)
Definition player.h:150
f32 movement_liquid_sink
Definition player.h:186
f32 movement_speed_walk
Definition player.h:179
core::vector2d< f32 > v2f
Definition irr_v2d.h:11
core::vector3df v3f
Definition irr_v3d.h:11
bool is_valid_player_name(std::string_view name)
Definition player.cpp:19
Definition collision.h:30
Definition inventory.h:19
bool place
Definition player.h:93
void unpackKeysPressed(u32 keypress_bits)
Definition player.cpp:242
void setMovementFromKeys()
Definition player.cpp:162
float yaw
Definition player.h:96
bool dig
Definition player.h:92
bool isMoving() const
Definition player.h:81
float movement_direction
Definition player.h:98
float pitch
Definition player.h:95
bool zoom
Definition player.h:91
bool aux1
Definition player.h:89
u8 direction_keys
Definition player.h:87
bool sneak
Definition player.h:90
float movement_speed
Definition player.h:97
PlayerControl(bool a_up, bool a_down, bool a_left, bool a_right, bool a_jump, bool a_aux1, bool a_sneak, bool a_zoom, bool a_dig, bool a_place, float a_pitch, float a_yaw, float a_movement_speed, float a_movement_direction)
Definition player.h:49
v2f getMovement() const
Definition player.cpp:253
u32 getKeysPressed() const
Definition player.cpp:198
bool jump
Definition player.h:88
bool is_multiplier
Definition player.h:28
bool operator==(const PlayerFovSpec &other) const
Definition player.h:34
f32 transition_time
Definition player.h:32
f32 fov
Definition player.h:25
bool operator!=(const PlayerFovSpec &other) const
Definition player.h:40
float speed_fast
Definition player.h:119
float speed_walk
Definition player.h:121
float liquid_sink
Definition player.h:116
bool new_move
Definition player.h:110
float liquid_fluidity
Definition player.h:114
bool operator!=(const PlayerPhysicsOverride &other) const
Definition player.h:124
bool operator==(const PlayerPhysicsOverride &other) const
Definition player.cpp:269
float acceleration_air
Definition player.h:118
float jump
Definition player.h:104
bool sneak
Definition player.h:107
float acceleration_default
Definition player.h:117
bool sneak_glitch
Definition player.h:108
float liquid_fluidity_smooth
Definition player.h:115
float speed_crouch
Definition player.h:113
float speed
Definition player.h:103
float speed_climb
Definition player.h:112
float acceleration_fast
Definition player.h:120
float gravity
Definition player.h:105