11#include <glm/gtc/matrix_transform.hpp>
136 std::chrono::nanoseconds fall_start_time = std::chrono::nanoseconds(0);
137 glm::dvec3 fall_start_position = glm::dvec3(0.0);
139 std::chrono::nanoseconds last_jump_time = std::chrono::steady_clock::now().time_since_epoch();
140 std::chrono::milliseconds jump_delai = std::chrono::milliseconds(500);
141 std::chrono::milliseconds jump_delai_after_fall = std::chrono::milliseconds(100);
143 std::chrono::nanoseconds last_attack_time = std::chrono::steady_clock::now().time_since_epoch();
144 std::chrono::milliseconds attack_delai = std::chrono::milliseconds(200);
146 std::chrono::nanoseconds last_use_time = std::chrono::steady_clock::now().time_since_epoch();
147 std::chrono::milliseconds use_delai = std::chrono::milliseconds(200);
149 void updateTransform();
Type
Definition: Block.hpp:33
A simple camera class.
Definition: Camera.hpp:41
Definition: HitBox.hpp:11
Definition: Player.hpp:32
void moveDirection(double x_offset, double y_offset)
Definition: Player.cpp:19
bool canAttack() const
Definition: Player.cpp:113
glm::dvec3 cameraPosition() const
Definition: Player.cpp:51
void startAttack()
Definition: Player.cpp:118
bool swimming
Definition: Player.hpp:98
Player & operator=(Player &other)=delete
bool jumping
Definition: Player.hpp:97
bool canJump() const
Definition: Player.cpp:98
double gravity
Definition: Player.hpp:90
glm::dvec3 direction() const
Definition: Player.cpp:32
double yaw
Definition: Player.hpp:111
void startUse()
Definition: Player.cpp:128
enum Player::GameMode gameMode
glm::dvec3 eye_position
Definition: Player.hpp:110
int toolbar_cursor
Definition: Player.hpp:132
bool on_ground
Definition: Player.hpp:93
double default_speed
Definition: Player.hpp:84
double fly_speed_factor
Definition: Player.hpp:87
std::array< ItemInfo::Type, 9 > toolbar_items
Definition: Player.hpp:121
bool shouldFall() const
Definition: Player.cpp:77
uint64_t player_id
Definition: Player.hpp:117
bool sprinting
Definition: Player.hpp:96
Player & operator=(Player &&other)=delete
bool canUse() const
Definition: Player.cpp:123
BlockInfo::Type ground_block
Definition: Player.hpp:100
Player(Player &&other)=delete
GameMode
Definition: Player.hpp:72
~Player()
Definition: Player.cpp:15
void startFall()
Definition: Player.cpp:87
RayCastOnBlockResult targeted_block
Definition: Player.hpp:114
uint64_t connection_id
Definition: Player.hpp:116
bool sneaking
Definition: Player.hpp:95
bool flying
Definition: Player.hpp:94
double jump_force
Definition: Player.hpp:89
void startJump()
Definition: Player.cpp:106
double jump_speed_factor
Definition: Player.hpp:88
glm::dvec3 velocity
Definition: Player.hpp:106
HitBox hitbox
Definition: Player.hpp:103
ViewMode
Definition: Player.hpp:79
enum Player::ViewMode view_mode
double fallDuration()
Definition: Player.cpp:93
uint64_t player_ticket_id
Definition: Player.hpp:118
double sneak_speed_factor
Definition: Player.hpp:86
double sprint_speed_factor
Definition: Player.hpp:85
HitBox feet
Definition: Player.hpp:104
Camera camera() const
Definition: Player.cpp:27
int jump_remaining
Definition: Player.hpp:108
bool isFlying() const
Definition: Player.cpp:82
bool shouldCollide() const
Definition: Player.cpp:72
Player(Player &other)=delete
glm::dvec3 getTransformedMovement(glm::dvec3 move) const
Definition: Player.cpp:41
TracyLockableN(std::mutex, mutex, "Player internal")
double pitch
Definition: Player.hpp:112
Player()
Definition: Player.cpp:11
Definition: Player.hpp:22
glm::vec3 hit_position
Definition: Player.hpp:26
BlockInfo::Type block
Definition: Player.hpp:27
glm::vec3 block_position
Definition: Player.hpp:24
bool inside_block
Definition: Player.hpp:28
bool hit
Definition: Player.hpp:23
glm::vec3 normal
Definition: Player.hpp:25