group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
ShotDebugReport.hpp
Go to the documentation of this file.
1
46
47#pragma once
48
49#include "ecs/components/Hitbox.hpp" // WorldCapsule
50
51#include <cstdint>
52#include <glm/vec3.hpp>
53#include <vector>
54
56{
57
59inline constexpr std::uint16_t k_missClientId = 0xFFFFu;
60
64{
65 float pointAx;
66 float pointAy;
67 float pointAz;
68 float pointBx;
69 float pointBy;
70 float pointBz;
71 float radius;
72 std::uint8_t region;
73 std::uint8_t _pad0;
74 std::uint16_t _pad1;
75};
76static_assert(sizeof(WireCapsule) == 32, "WireCapsule must be 32 B for the wire format");
77
82{
83 std::uint32_t shotInputTick;
84 std::uint16_t hitTargetClientId;
85 std::uint8_t hitRegion;
86 std::uint8_t numTargets;
88 float dirX, dirY, dirZ;
89 float range;
90 float hitX, hitY, hitZ;
91};
92static_assert(sizeof(ReportHeader) == 48, "ReportHeader layout must be 48 B");
93
96{
97 std::uint16_t targetClientId;
98 std::uint8_t numCapsules;
99 std::uint8_t _pad;
100};
101static_assert(sizeof(TargetHeader) == 4, "TargetHeader layout must be 4 B");
102
111{
114 std::uint16_t shooterClientId = 0;
115 std::uint32_t shotInputTick = 0;
116 glm::vec3 origin{0.0f};
117 glm::vec3 direction{0.0f};
118 float range = 0.0f;
120 std::uint8_t hitRegion = 0;
121 glm::vec3 hitPoint{0.0f};
122
126 struct Target
127 {
128 std::uint16_t clientId;
129 std::vector<WorldCapsule> capsules;
130 };
131 std::vector<Target> targets;
132};
133
134} // namespace net::shotdebug
Skeleton-driven hitbox types: body regions, capsule definitions, damage profiles, and per-entity runt...
Definition ShotDebugReport.hpp:56
constexpr std::uint16_t k_missClientId
Sentinel hitTargetClientId meaning "shot missed all targets".
Definition ShotDebugReport.hpp:59
Header that precedes the variable-length per-target body of the SHOT_DEBUG_REPORT packet.
Definition ShotDebugReport.hpp:82
std::uint8_t hitRegion
Definition ShotDebugReport.hpp:85
float hitX
Definition ShotDebugReport.hpp:90
float originZ
Definition ShotDebugReport.hpp:87
float dirZ
Definition ShotDebugReport.hpp:88
float originY
Definition ShotDebugReport.hpp:87
float dirY
Definition ShotDebugReport.hpp:88
std::uint8_t numTargets
Definition ShotDebugReport.hpp:86
float originX
Definition ShotDebugReport.hpp:87
float hitZ
Definition ShotDebugReport.hpp:90
float range
Definition ShotDebugReport.hpp:89
std::uint16_t hitTargetClientId
Definition ShotDebugReport.hpp:84
float hitY
Definition ShotDebugReport.hpp:90
std::uint32_t shotInputTick
Definition ShotDebugReport.hpp:83
float dirX
Definition ShotDebugReport.hpp:88
Per in-range target's REWOUND capsule list at fire-time.
Definition ShotDebugReport.hpp:127
std::vector< WorldCapsule > capsules
Definition ShotDebugReport.hpp:129
std::uint16_t clientId
Definition ShotDebugReport.hpp:128
Server-side runtime capture of one shot's debug data, produced by WeaponSystem::handleFire and consum...
Definition ShotDebugReport.hpp:111
glm::vec3 origin
Definition ShotDebugReport.hpp:116
std::uint16_t shooterClientId
The shooter's network ClientId.
Definition ShotDebugReport.hpp:114
glm::vec3 hitPoint
Definition ShotDebugReport.hpp:121
std::uint32_t shotInputTick
Definition ShotDebugReport.hpp:115
float range
Definition ShotDebugReport.hpp:118
std::uint16_t hitTargetClientId
Definition ShotDebugReport.hpp:119
glm::vec3 direction
Definition ShotDebugReport.hpp:117
std::vector< Target > targets
Definition ShotDebugReport.hpp:131
std::uint8_t hitRegion
Definition ShotDebugReport.hpp:120
Per-target sub-header preceding the variable-length capsule list.
Definition ShotDebugReport.hpp:96
std::uint8_t _pad
Definition ShotDebugReport.hpp:99
std::uint8_t numCapsules
Definition ShotDebugReport.hpp:98
std::uint16_t targetClientId
Definition ShotDebugReport.hpp:97
One capsule on the wire.
Definition ShotDebugReport.hpp:64
float pointAz
Definition ShotDebugReport.hpp:67
float pointAx
Definition ShotDebugReport.hpp:65
std::uint8_t _pad0
Manual alignment.
Definition ShotDebugReport.hpp:73
std::uint16_t _pad1
Definition ShotDebugReport.hpp:74
float pointBy
Definition ShotDebugReport.hpp:69
float pointBz
Definition ShotDebugReport.hpp:70
std::uint8_t region
BodyRegion enum value.
Definition ShotDebugReport.hpp:72
float pointAy
Definition ShotDebugReport.hpp:66
float radius
Definition ShotDebugReport.hpp:71
float pointBx
Definition ShotDebugReport.hpp:68