refactor player

This commit is contained in:
2024-08-27 15:29:45 +02:00
parent 0d72e7f765
commit 3c6a3dba44
7 changed files with 80 additions and 93 deletions

View File

@@ -0,0 +1,36 @@
#pragma once
#include <client/Player.h>
#include <godot_cpp/classes/input_event_mouse_motion.hpp>
namespace blitz {
class PlayerController : public godot::Node {
GDCLASS(PlayerController, godot::Node)
protected:
static void _bind_methods();
public:
PlayerController();
~PlayerController();
// Godot overrides
void _unhandled_input(const godot::Ref<godot::InputEvent>&);
void _process(float delta);
void _ready();
private:
godot::Camera3D* m_Camera;
float m_BobTime;
float m_Speed;
Player* m_Player;
godot::Node3D* m_Head;
void UpdateBobbing(float delta);
void UpdateFOV(float delta);
void UpdateCamera(const godot::InputEventMouseMotion&);
void UpdateVelocity(float delta);
void Shoot();
};
} // namespace blitz