56#if PROTOCOL_VERSION > 767
356 const float new_pitch =
static_cast<float>(-std::asin(direction.
y) * 57.29577951308232 );
357 float new_yaw =
static_cast<float>(-std::atan2(direction.
x, direction.
z) * 57.29577951308232 );
362 if (new_yaw !=
yaw ||
363 (set_pitch && new_pitch !=
pitch))
376 const float rad_yaw =
yaw * 0.017453292f ;
377 const float rad_pitch =
pitch * 0.017453292f ;
378 const float cos_pitch = std::cos(rad_pitch);
424#if PROTOCOL_VERSION < 405
virtual double GetHeightImpl() const
std::shared_mutex entity_mutex
Vector3< double > position
void SetFoodSaturation(const float food_saturation_)
void SetAbilitiesFlags(const char abilities_flags_)
void SetInputsLeft(const float f)
float GetFoodSaturation() const
void SetFood(const int food_)
bool horizontal_collision
virtual bool IsLocalPlayer() const override
virtual void SetPitch(const float pitch_) override
Set Pitch angle (look up is -90°, look down is 90°)
virtual void SetPosition(const Vector3< double > &pos) override
void SetInputsForward(const float f)
virtual void SetZ(const double z) override
float GetFlyingSpeed() const
void SetInputsSprint(const bool b)
Vector3< double > GetRightVector() const
PlayerInputs last_sent_inputs
char GetAbilitiesFlags() const
bool previous_horizontal_collision
void SetFlyingSpeed(const float flying_speed_)
int sprint_double_tap_trigger_time
Vector3< double > stuck_speed_multiplier
int fly_jump_trigger_time
virtual void SetY(const double y) override
void AddInputsForward(const float f)
void SetAbilitiesFlagsImpl(const char abilities_flags_)
bool GetInvulnerable() const
void SetWalkingSpeed(const float walking_speed_)
bool flying
Flying in creative/spectator.
Vector3< double > right_vector
bool GetDirtyInputs() const
Vector3< double > GetXZVector() const
GameType GetGameMode() const
void SetInputs(const PlayerInputs &inputs_)
void AddInputsLeft(const float f)
void UpdateAbilitiesFlagsImpl()
std::optional< Position > supporting_block_pos
virtual void SetX(const double x) override
void SetHealth(const float health_)
virtual void SetYaw(const float yaw_) override
Set Yaw angle (horizontal plane orientation)
virtual bool IsRemotePlayer() const override
void SetInputsJump(const bool b)
void LookAt(const Vector3< double > &pos, const bool set_pitch=false)
float GetWalkingSpeed() const
Vector3< double > GetFrontVector() const
Vector3< double > xz_vector
bool may_fly
If this player can fly in creative/spectator.
void SetGameMode(const GameType game_mode_)
bool on_ground_without_supporting_block
bool previous_shift_key_down
bool instabuild
Insta break blocks in creative.
Vector3< double > front_vector
bool GetInstabuild() const
If true, the player can break any block in no time (creative mode)
Vector3< double > previous_position
void SetInputsSneak(const bool b)
virtual double GetEyeHeightImpl() const