generated from Persson-dev/Godot-Xmake
refactor player
This commit is contained in:
36
include/client/PlayerController.h
Normal file
36
include/client/PlayerController.h
Normal 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
|
||||
Reference in New Issue
Block a user