Skip to main content

Module debris

Module debris 

Source
Expand description

Combat debris physics system for Chaos RPG.

When an entity dies its constituent glyphs become rigid-body debris that scatter, bounce, settle and fade according to the element of the killing blow. Each DebrisType variant encodes unique physical behaviour (fire debris floats upward, ice shatters on impact, etc.).

The system is built around a pre-allocated DebrisPool of 500 particles that are recycled as they expire, a DebrisSimulator that steps physics each frame, and a DebrisRenderer that exports live debris as GlyphInstance data for GPU instanced rendering.

Structs§

ArenaCollider
Defines the arena boundaries as six axis-aligned planes (floor, ceiling, four walls).
CameraTrauma
Camera shake / trauma descriptor emitted alongside debris.
CollisionResult
Collision result from testing a particle against the arena.
DeathEffect
Orchestrates a complete entity death sequence: debris spawn, camera trauma, sound cue, and element-specific animations.
DebrisParticle
A single piece of combat debris — a glyph char with rigid-body dynamics.
DebrisPool
Pre-allocated pool of debris particles. Dead particles are recycled.
DebrisRenderer
Converts live debris particles into GlyphInstance data suitable for GPU instanced rendering.
DebrisSimulator
Steps all debris particles each frame with gravity, collision, friction, buoyancy, drag, and settling logic.
DebrisSpawner
Spawns debris particles into a DebrisPool from entity death events.
EntityDeathEvent
Information about an entity death, used by DebrisSpawner.
SoundCue
Sound cue hint emitted with death effects.

Enums§

DebrisType
Element-specific debris behaviour.