generated from Persson-dev/Godot-Xmake
56 lines
1.1 KiB
C++
56 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <godot_cpp/classes/animation_tree.hpp>
|
|
#include <godot_cpp/classes/character_body3d.hpp>
|
|
#include <godot_cpp/classes/node3d.hpp>
|
|
#include <blitz/common/Types.h>
|
|
|
|
namespace blitz {
|
|
|
|
class World;
|
|
|
|
class Player : public godot::Node {
|
|
|
|
GDCLASS(Player, godot::Node);
|
|
|
|
protected:
|
|
static void _bind_methods();
|
|
|
|
public:
|
|
Player();
|
|
~Player();
|
|
|
|
void _ready() override;
|
|
virtual void _physics_process(float delta);
|
|
|
|
godot::Vector3 GetPosition() const;
|
|
void SetPosition(const godot::Vector3& a_Position);
|
|
|
|
godot::Vector3 GetVelocity() const;
|
|
void SetVelocity(const godot::Vector3& a_Velocity);
|
|
|
|
|
|
godot::Vector3 GetCameraRotation() const;
|
|
void SetCameraRotation(const godot::Vector3& a_Rotation);
|
|
|
|
PlayerID GetId() const {
|
|
return m_PeerId;
|
|
}
|
|
|
|
protected:
|
|
godot::Node3D* m_Mesh;
|
|
godot::Node3D* m_Head;
|
|
godot::AnimationTree* m_AnimationTree;
|
|
godot::CharacterBody3D* m_Player;
|
|
|
|
godot::Vector3 m_SnapVector;
|
|
PeerID m_PeerId;
|
|
|
|
void SetModelVisible(bool visible);
|
|
void UpdateAnimation(float delta);
|
|
void BlendAnimation(const godot::String& a_AnimationName, float a_Goal, float a_Delta);
|
|
|
|
friend class World;
|
|
};
|
|
} // namespace blitz
|