Skip to main content

Module weapon_physics

Module weapon_physics 

Source
Expand description

Weapon physics and combat trail system for Chaos RPG.

Provides swing arc simulation, weapon trail rendering (ribbon mesh generation), impact effects (camera shake, debris, distortion rings), damage number popups with physics-based arcs, combo-trail integration, block/parry feedback, and per-element visual effect descriptors.

Structs§

BlockEffect
Visual and physical feedback when an attack is blocked.
CameraShake
Screen camera shake triggered by weapon impacts.
ComboMilestoneEffect
Describes the special visual effect triggered at a combo milestone.
ComboTrailIntegration
Computes trail visual modifiers based on the current combo count.
DamageNumber
A floating damage number with physics-based arc movement.
DamageNumberManager
Object pool of DamageNumber instances. Re-uses slots to avoid allocation.
DebrisGlyph
A small glyph fragment that flies off when an entity is struck.
ElementEffect
Describes the visual effect played when a weapon with a given element strikes an entity.
ImpactEffect
Full description of an impact event, combining camera shake, debris, trail compression, damage number, shockwave, and element-specific effects.
ParryBurstParticle
A single particle from the parry burst.
ParryEffect
Visual and gameplay feedback for a perfect-timing parry.
ShockwaveRing
A screen-space distortion ring (shockwave) expanding outward from the impact point.
SparkParticle
A single spark particle emitted on block.
SwingArc
Describes a circular swing arc in 3D space (in the XZ plane centred at origin). The weapon tip traces from start_angle to end_angle over duration seconds at the given radius (== weapon length).
TrailRibbon
Converts a set of trail segments into a triangle-strip mesh suitable for GPU rendering. Each segment produces two vertices (centre +/- width * perpendicular direction). Colour fades with age; emission increases near impact points.
TrailVertex
A vertex emitted by the trail ribbon builder, ready for GPU upload.
WeaponPhysicsSystem
Top-level system that ties together weapon trails, impact effects, damage numbers, and combo integration.
WeaponProfile
Physical and visual properties that govern how a weapon behaves during swings, impacts, and trail rendering.
WeaponProfiles
Factory methods returning canonical WeaponProfile for each WeaponType.
WeaponTrail
Manages a ring buffer of trail segments, spawning them along a swing arc and applying impact compression.
WeaponTrailSegment
A single segment of the weapon trail ribbon.

Enums§

WeaponType
The ten weapon archetypes available in Chaos RPG.

Functions§

spawn_debris
Spawn a batch of debris glyphs from a hit.