mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
Refactor
This commit is contained in:
parent
e2bb7a34aa
commit
9760cff8f4
10 changed files with 76 additions and 85 deletions
|
|
@ -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_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue