generated from Persson-dev/Godot-Xmake
fix position sync issues
All checks were successful
Linux arm64 / Build (pull_request) Successful in 1m31s
All checks were successful
Linux arm64 / Build (pull_request) Successful in 1m31s
This commit is contained in:
@@ -25,7 +25,6 @@ class World : public godot::Node3D, public protocol::PacketHandler {
|
||||
|
||||
void HandlePacket(const protocol::packets::PlayerJoin&) override;
|
||||
void HandlePacket(const protocol::packets::PlayerLeave&) override;
|
||||
void HandlePacket(const protocol::packets::PlayerPositionAndRotation&) override;
|
||||
|
||||
protected:
|
||||
NetworkInterface* m_NetworkInterface;
|
||||
|
||||
@@ -12,6 +12,8 @@ class ClientWorld : public World {
|
||||
~ClientWorld();
|
||||
void _process(float delta);
|
||||
|
||||
void HandlePacket(const protocol::packets::PlayerPositionAndRotation&) override;
|
||||
|
||||
private:
|
||||
void UpdatePlayerPos();
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ class FirstPersonPlayer : public Player {
|
||||
|
||||
// Godot overrides
|
||||
void _unhandled_input(const godot::Ref<godot::InputEvent>&);
|
||||
void _physics_process(float delta);
|
||||
void _physics_process(float delta) override;
|
||||
void _ready() override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -21,7 +21,7 @@ class Player : public godot::CharacterBody3D {
|
||||
~Player();
|
||||
|
||||
void _ready();
|
||||
void _physics_process(float delta);
|
||||
virtual void _physics_process(float delta);
|
||||
void animate(float delta);
|
||||
|
||||
godot::Vector3 GetCameraRotation() const;
|
||||
@@ -36,7 +36,6 @@ class Player : public godot::CharacterBody3D {
|
||||
godot::AnimationTree* m_AnimationTree;
|
||||
|
||||
godot::Vector3 m_SnapVector;
|
||||
float m_Speed;
|
||||
PeerID m_PeerId;
|
||||
|
||||
friend class World;
|
||||
|
||||
@@ -12,7 +12,8 @@ class ServerWorld : public World {
|
||||
~ServerWorld();
|
||||
void _process(float delta);
|
||||
|
||||
private:
|
||||
void HandlePacket(const protocol::packets::PlayerPositionAndRotation&) override;
|
||||
|
||||
void SyncPlayersPos();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user