16#include <unordered_map>
181 defs.push_back({
"mixamorig:Head", -1,
BodyRegion::Head, {0, 8, 2.5f}, 13.7f, 2.4f, {0,-1,0}});
182 defs.push_back({
"mixamorig:Neck", -1,
BodyRegion::Neck, {0, 3, 1.5f}, 6.0f, 2.0f, {0,-1,0}});
183 defs.push_back({
"mixamorig:Spine2", -1,
BodyRegion::UpperTorso, {0, 0.5f,0}, 15.4f, 3.9f, {0,-1,0}});
184 defs.push_back({
"mixamorig:Spine1", -1,
BodyRegion::LowerTorso, {0, -22.5f,-2.0f}, 16.3f, 0.5f, {0,-1,0}});
185 defs.push_back({
"mixamorig:LeftArm", -1,
BodyRegion::LeftUpperArm, {0, 10, 0}, 6.7f, 12.0f, {0,-1,0}});
186 defs.push_back({
"mixamorig:LeftForeArm", -1,
BodyRegion::LeftLowerArm, {0, 23, 0}, 6.0f, 18.3f, {0,-1,0}});
187 defs.push_back({
"mixamorig:RightArm", -1,
BodyRegion::RightUpperArm, {0, 10, 0}, 6.7f, 12.0f, {0,-1,0}});
188 defs.push_back({
"mixamorig:RightForeArm", -1,
BodyRegion::RightLowerArm, {0, 23, 0}, 6.0f, 18.3f, {0,-1,0}});
189 defs.push_back({
"mixamorig:LeftUpLeg", -1,
BodyRegion::LeftUpperLeg, {-2.5f,24.5f,0}, 10.5f, 15.4f, {0,-1,0}});
190 defs.push_back({
"mixamorig:LeftLeg", -1,
BodyRegion::LeftLowerLeg, {0, 24.5f,0}, 8.3f, 20.0f, {0,-1,0}});
191 defs.push_back({
"mixamorig:RightUpLeg", -1,
BodyRegion::RightUpperLeg, {2.5f,24.5f,0}, 10.5f, 15.4f, {0,-1,0}});
192 defs.push_back({
"mixamorig:RightLeg", -1,
BodyRegion::RightLowerLeg, {0, 24.5f,0}, 8.3f, 20.0f, {0,-1,0}});
203 auto it = jointMap.find(def.boneName);
204 if (it != jointMap.end()) {
205 def.boneIndex = it->second;
const char * bodyRegionName(BodyRegion region)
Human-readable name for a body region (UI / kill feed / logging).
Definition Hitbox.hpp:40
BodyRegion
Body regions.
Definition Hitbox.hpp:23
@ RightLowerLeg
Definition Hitbox.hpp:35
@ LeftUpperLeg
Definition Hitbox.hpp:32
@ UpperTorso
Definition Hitbox.hpp:26
@ LeftLowerArm
Definition Hitbox.hpp:29
@ LowerTorso
Definition Hitbox.hpp:27
@ RightUpperLeg
Definition Hitbox.hpp:34
@ Neck
Definition Hitbox.hpp:25
@ RightUpperArm
Definition Hitbox.hpp:30
@ Head
Definition Hitbox.hpp:24
@ LeftUpperArm
Definition Hitbox.hpp:28
@ RightLowerArm
Definition Hitbox.hpp:31
@ LeftLowerLeg
Definition Hitbox.hpp:33
@ Count
Definition Hitbox.hpp:36
const DamageProfile & defaultDamageProfile()
Global (default) damage profile accessor.
Definition Hitbox.hpp:145
Damage profile.
Definition Hitbox.hpp:125
std::array< float, static_cast< size_t >(BodyRegion::Count)> multipliers
Definition Hitbox.hpp:127
Debug: hit detection snapshot (for client-server mismatch debugging).
Definition Hitbox.hpp:220
uint32_t tick
Tick when the shot was fired.
Definition Hitbox.hpp:221
bool serverRejected
True if server rejected the hit.
Definition Hitbox.hpp:230
glm::vec3 shooterEye
Ray origin.
Definition Hitbox.hpp:222
glm::vec3 targetPos
Target entity position at time of shot.
Definition Hitbox.hpp:224
std::vector< WorldCapsule > clientCapsules
Client-side hitbox state.
Definition Hitbox.hpp:226
BodyRegion clientHitRegion
What the client thought it hit.
Definition Hitbox.hpp:228
float targetYaw
Target yaw at time of shot.
Definition Hitbox.hpp:225
std::vector< WorldCapsule > serverCapsules
Server-side state (filled on rejection).
Definition Hitbox.hpp:227
glm::vec3 shooterDir
Ray direction.
Definition Hitbox.hpp:223
bool serverConfirmed
True if server confirmed the hit.
Definition Hitbox.hpp:229
Hitbox definition (static, per-rig).
Definition Hitbox.hpp:81
glm::vec3 localAxis
Capsule axis direction in bone-local space.
Definition Hitbox.hpp:88
glm::vec3 localOffset
Offset from bone origin in bone-local space.
Definition Hitbox.hpp:85
float halfHeight
Capsule half-height of centerline.
Definition Hitbox.hpp:87
int boneIndex
Resolved runtime joint index (-1 = unresolved).
Definition Hitbox.hpp:83
std::string boneName
Skeleton joint name (e.g. "mixamorig:Head").
Definition Hitbox.hpp:82
BodyRegion region
Which body part this covers.
Definition Hitbox.hpp:84
float radius
Capsule radius (rig model-space units).
Definition Hitbox.hpp:86
ECS components.
Definition Hitbox.hpp:108
std::vector< WorldCapsule > capsules
~12 capsules per character.
Definition Hitbox.hpp:109
Hitbox rig (shared per character archetype).
Definition Hitbox.hpp:159
std::vector< HitboxDef > definitions
Definition Hitbox.hpp:160
void resolveIndices(const std::unordered_map< std::string, int > &jointMap)
Resolve bone names to runtime joint indices.
Definition Hitbox.hpp:200
static HitboxRig buildMixamoDefault()
Build the default Mixamo-rig hitbox definitions (12 capsules).
Definition Hitbox.hpp:167
ECS component: per-entity model-space joint matrices from animation.
Definition Hitbox.hpp:117
std::vector< glm::mat4 > matrices
Model-space joint transforms, one per skeleton joint.
Definition Hitbox.hpp:118
Runtime capsule (world-space, per-entity, per-frame).
Definition Hitbox.hpp:95
glm::vec3 pointA
One endpoint of the capsule centerline.
Definition Hitbox.hpp:96
float radius
Capsule radius (world units).
Definition Hitbox.hpp:98
glm::vec3 pointB
Other endpoint of the capsule centerline.
Definition Hitbox.hpp:97
BodyRegion region
For damage multiplier lookup.
Definition Hitbox.hpp:99