16#include <unordered_map>
186 defs.push_back({
"mixamorig:Head", -1,
BodyRegion::Head, {0, 3.4f, 1.1f}, 5.8f, 1.0f, {0,-1,0}});
187 defs.push_back({
"mixamorig:Neck", -1,
BodyRegion::Neck, {0, 1.3f, 0.6f}, 2.5f, 0.8f, {0,-1,0}});
188 defs.push_back({
"mixamorig:Spine2", -1,
BodyRegion::UpperTorso, {0, -2.8f, 0}, 7.45f, 2.5f, {0,-1,0}});
189 defs.push_back({
"mixamorig:Spine1", -1,
BodyRegion::LowerTorso, {0, -9.05f,-0.8f}, 8.0f, 0.9f, {0,-1,0}});
190 defs.push_back({
"mixamorig:LeftArm", -1,
BodyRegion::LeftUpperArm, {0, 4.2f, 0}, 2.8f, 5.1f, {0,-1,0}});
191 defs.push_back({
"mixamorig:LeftForeArm", -1,
BodyRegion::LeftLowerArm, {0, 9.7f, 0}, 2.5f, 7.7f, {0,-1,0}});
192 defs.push_back({
"mixamorig:RightArm", -1,
BodyRegion::RightUpperArm, {0, 4.2f, 0}, 2.8f, 5.1f, {0,-1,0}});
193 defs.push_back({
"mixamorig:RightForeArm", -1,
BodyRegion::RightLowerArm, {0, 9.7f, 0}, 2.5f, 7.7f, {0,-1,0}});
194 defs.push_back({
"mixamorig:LeftUpLeg", -1,
BodyRegion::LeftUpperLeg, {-1.1f,10.4f, 0}, 4.4f, 6.5f, {0,-1,0}});
195 defs.push_back({
"mixamorig:LeftLeg", -1,
BodyRegion::LeftLowerLeg, {0, 10.4f, 0}, 4.4f, 8.5f, {0,-1,0}});
196 defs.push_back({
"mixamorig:RightUpLeg", -1,
BodyRegion::RightUpperLeg, {1.1f, 10.4f, 0}, 4.4f, 6.5f, {0,-1,0}});
197 defs.push_back({
"mixamorig:RightLeg", -1,
BodyRegion::RightLowerLeg, {0, 10.4f, 0}, 4.4f, 8.5f, {0,-1,0}});
208 auto it = jointMap.find(def.boneName);
209 if (it != jointMap.end()) {
210 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:225
uint32_t tick
Tick when the shot was fired.
Definition Hitbox.hpp:226
bool serverRejected
True if server rejected the hit.
Definition Hitbox.hpp:235
glm::vec3 shooterEye
Ray origin.
Definition Hitbox.hpp:227
glm::vec3 targetPos
Target entity position at time of shot.
Definition Hitbox.hpp:229
std::vector< WorldCapsule > clientCapsules
Client-side hitbox state.
Definition Hitbox.hpp:231
BodyRegion clientHitRegion
What the client thought it hit.
Definition Hitbox.hpp:233
float targetYaw
Target yaw at time of shot.
Definition Hitbox.hpp:230
std::vector< WorldCapsule > serverCapsules
Server-side state (filled on rejection).
Definition Hitbox.hpp:232
glm::vec3 shooterDir
Ray direction.
Definition Hitbox.hpp:228
bool serverConfirmed
True if server confirmed the hit.
Definition Hitbox.hpp:234
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, bone-local dir, WORLD-unit magnitude.
Definition Hitbox.hpp:85
float halfHeight
Capsule half-height of centerline (WORLD units).
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 (WORLD units; scale-invariant across rigs).
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:205
static HitboxRig buildMixamoDefault()
Build the default Mixamo-rig hitbox definitions (12 capsules).
Definition Hitbox.hpp:172
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