SPECIFICATION: True Volumetric Sub-Millimeter Mesh Collisions
Hardware-Accelerated Zero-Hitbox Physics Engine
Traditional fighting games rely on 1990s discrete bounding boxes and bone-attached capsules. This document specifies a modern, hardware-accelerated volumetric collision architecture.
Note
All collision calculations execute in parallel on GPU compute workgroups (
@workgroup_size(64)) in under 0.1 ms per frame.1. Mathematical Foundations
Each skeletal limb is enveloped in analytical Signed Distance Fields (SDFs) $ d(\vec{x}) $:
$$ d(\vec{x}) < 0 \implies \text{Inside Flesh (Penetration)} $$
$$ d(\vec{x}) = 0 \implies \text{Exact Surface Contact} $$
$$ d(\vec{x}) > 0 \implies \text{Outside Surface} $$
Continuous Swept-Volume Formula (Zero Tunneling)
To prevent fast strikes from ghosting through targets between frames:$$ \vec{X}_{\text{swept}}(s, \tau) = (1-\tau)\vec{x}_t(s) + \tau \vec{x}_{t+1}(s), \quad \tau \in [0, 1] $$
2. Hit Severity Classification
| Penetration Depth (\delta) | Classification | Gameplay Reaction |
|---|---|---|
| 0.0 cm ≤ \delta < 0.5 cm | Glancing Graze | 15% Damage, spark deflection |
| 0.5 cm ≤ \delta < 3.0 cm | Clean Hit | 100% Damage, standard hitstop |
| 3.0 cm ≤ \delta | Crushing Counter | 150% Damage, crumple stun & torque |
3. Compute Shader Pipeline
wgsl
@compute @workgroup_size(64)
fn solveCollisions(@builtin(global_invocation_id) global_id: vec3u) {
let ptIndex = global_id.x;
if (penetrationDepth > 0.0) {
let slot = atomicAdd(&ledger.count, 1u);
ledger.contacts[slot].point = vec4f(contactPos, penetrationDepth);
ledger.contacts[slot].normal = vec4f(contactNormal, impactVelocity);
}
}
Tip
Use 3D spatial hash grids with $ 5.0\text{ cm} $ cell bounds to query point proximity in $ O(1) $ constant time.