mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
refactor PlayerController
This commit is contained in:
parent
1777600275
commit
315b4b44e1
3 changed files with 12 additions and 11 deletions
|
|
@ -14,6 +14,7 @@ class Chunks;
|
|||
class BlocksController;
|
||||
struct Hitbox;
|
||||
struct CameraSettings;
|
||||
struct EngineSettings;
|
||||
|
||||
class CameraControl {
|
||||
std::shared_ptr<Player> player;
|
||||
|
|
@ -46,7 +47,7 @@ public:
|
|||
};
|
||||
|
||||
class PlayerController {
|
||||
Engine* engine;
|
||||
const EngineSettings& settings;
|
||||
Level* level;
|
||||
std::shared_ptr<Player> player;
|
||||
PlayerInput input {};
|
||||
|
|
@ -58,7 +59,7 @@ class PlayerController {
|
|||
void resetKeyboard();
|
||||
void updatePlayer(float delta);
|
||||
void updateEntityInteraction(entityid_t eid, bool lclick, bool rclick);
|
||||
void updateInteraction();
|
||||
void updateInteraction(float delta);
|
||||
|
||||
float stepsTimer = 0.0f;
|
||||
void onFootstep(const Hitbox& hitbox);
|
||||
|
|
@ -68,7 +69,7 @@ class PlayerController {
|
|||
voxel* updateSelection(float maxDistance);
|
||||
public:
|
||||
PlayerController(
|
||||
Engine* engine, Level* level, BlocksController* blocksController
|
||||
const EngineSettings& settings, Level* level, BlocksController* blocksController
|
||||
);
|
||||
void update(float delta, bool input, bool pause);
|
||||
void postUpdate(float delta, bool input, bool pause);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue