brodacast shoot

This commit is contained in:
2024-08-27 16:21:42 +02:00
parent 2353cbb2be
commit 89b62317d4
6 changed files with 52 additions and 12 deletions

View File

@@ -25,13 +25,15 @@ 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::PlayerShoot&) override;
protected:
NetworkInterface* m_NetworkInterface;
godot::Node* m_Players;
float m_PassedTime;
virtual void AddProjectile(
PlayerID a_Shooter, const godot::Vector3& a_Position, const godot::Vector3& a_Rotation, const godot::Vector3& a_Velocity);
virtual void AddPlayer(PlayerID a_PlayerId, godot::String a_PlayerName);
virtual void RemovePlayer(PlayerID a_PlayerId);
virtual void SetPlayerPositionAndRotation(

View File

@@ -1,9 +1,9 @@
#pragma once
#include <blitz/common/Types.h>
#include <vector>
#include <godot_cpp/variant/string.hpp>
#include <godot_cpp/variant/vector3.hpp>
#include <vector>
namespace blitz {
namespace protocol {
@@ -66,7 +66,12 @@ struct PlayerPositionAndRotation {
godot::Vector3 m_Velocity;
};
struct PlayerShoot {};
struct PlayerShoot {
PlayerID m_Sender;
godot::Vector3 m_Position;
godot::Vector3 m_Rotation;
godot::Vector3 m_Velocity;
};
} // namespace data
} // namespace protocol