This commit is contained in:
MihailRis
2024-01-10 16:41:51 +03:00
parent e2bb7a34aa
commit 9760cff8f4
10 changed files with 76 additions and 85 deletions
+10 -5
View File
@@ -1,6 +1,7 @@
#ifndef SRC_OBJECTS_PLAYER_H_
#define SRC_OBJECTS_PLAYER_H_
#include <memory>
#include <glm/glm.hpp>
#include "../voxels/voxel.h"
@@ -29,13 +30,14 @@ struct PlayerInput {
class Player {
float speed;
itemid_t chosenItem;
public:
Camera* camera, *SPCamera, *TPCamera, *currentViewCamera;
Hitbox* hitbox;
std::shared_ptr<Camera> camera, spCamera, tpCamera;
std::shared_ptr<Camera> currentCamera;
std::unique_ptr<Hitbox> hitbox;
bool flight = false;
bool noclip = false;
bool debug = false;
int chosenItem;
voxel selectedVoxel {0, 0};
glm::vec2 cam = {};
@@ -44,9 +46,12 @@ public:
~Player();
void teleport(glm::vec3 position);
float getSpeed() const;
void update(Level* level, PlayerInput& input, float delta);
void setChosenItem(itemid_t id);
itemid_t getChosenItem() const;
float getSpeed() const;
};
#endif /* SRC_OBJECTS_PLAYER_H_ */