refactor: PlayerController

This commit is contained in:
MihailRis
2024-06-09 16:30:01 +03:00
parent b3ae8484a2
commit 4e696520b6
13 changed files with 207 additions and 186 deletions
+9 -3
View File
@@ -32,6 +32,14 @@ struct PlayerInput {
bool flight : 1;
};
struct BlockSelection {
voxel vox {0, {}};
glm::ivec3 position {};
glm::ivec3 actualPosition {};
glm::ivec3 normal {};
glm::vec3 hitPosition;
};
class Player : public Object, public Serializable {
float speed;
int chosenSlot;
@@ -44,10 +52,8 @@ public:
std::shared_ptr<Camera> currentCamera;
std::unique_ptr<Hitbox> hitbox;
bool debug = false;
voxel selectedVoxel {0, {}};
glm::vec3 cam {};
glm::ivec3 selectedBlockPosition {};
glm::ivec3 actualSelectedBlockPosition {};
BlockSelection selection {};
Player(glm::vec3 position, float speed, std::shared_ptr<Inventory> inv);
~Player();