23#include <entt/entt.hpp>
26#include <unordered_map>
46 bool init(SDL_GPUDevice* dev, SDL_GPUTextureFormat colorFmt, SDL_GPUShaderFormat shaderFmt);
78 void spawnFire(glm::vec3 pos,
float radius);
87 void spawnDeathDissolve(
const std::vector<glm::vec3>& worldPoints, glm::vec3 center, glm::vec4 color);
96 void driveGroundFire(entt::entity fieldEntity, glm::vec3 pos,
float radius,
float remaining,
float duration);
99 void debugEnergyTeslaArc(glm::vec3 origin, glm::vec3 guidePoint, glm::vec3 hitPoint,
bool locked,
float lockStrength);
101 glm::vec3 guidePoint,
113 void drawWorldText(glm::vec3 worldPos, std::string_view text, glm::vec4 color,
float worldHeight);
120 void drawScreenText(glm::vec2 pixelPos, std::string_view text, glm::vec4 color,
float pixelHeight);
133 void update(
float dt, glm::vec3 eye, glm::vec3 forward, glm::vec3 right, glm::vec3 up,
Registry& reg);
149 void render(SDL_GPURenderPass* pass, SDL_GPUCommandBuffer* cmd);
Ring-buffer pool of world-space decal quads for bullet holes and scorch marks.
Camera class for the new renderer with combined view-projection matrix.
"Thanos snap" death dissolve — a character's last pose crumbles into wind-swept particles that drift ...
Sustained Railgun-style dense lightning for the EnergyGun.
Fresh layered explosion, fire, smoke, spark, and scorch VFX.
Hitscan energy beam effect using fBm path deviation and Bezier spines.
Spark burst and impact flash effect for projectile hits.
Event structs dispatched via entt::dispatcher for particle spawning.
Owns all particle GPU pipelines and per-category GPU buffers.
ExplosionVfxKind
Distinct explosion VFX profiles authored by weapon family.
Definition ParticleTypes.hpp:12
@ Rocket
Definition ParticleTypes.hpp:13
Projectile component and weapon/surface type enumerations.
Shared ECS registry type alias for the game engine.
entt::registry Registry
Shared ECS registry type alias.
Definition Registry.hpp:11
Camera-facing ribbon trail builder for slow/arcing projectiles.
High-level SDF text renderer for world-space and screen-space text.
Volumetric smoke billboard particle manager with back-to-front sorting.
SurfaceType
Surface material hit by a projectile / hitscan / contact.
Definition SurfaceType.hpp:28
Continuous, curved energy-arc beam for the auto-lock Tesla Cannon.
Oriented-capsule tracer management for fast-bullet projectile entities.
WeaponType
Weapon type — determines tracer style, damage, sound, and impact effects.
Definition WeaponState.hpp:12
Ring-buffer pool of 512 world-space decal quads (bullet holes, scorch marks).
Definition BulletHoleDecal.hpp:18
One-shot disintegration effect spawned from a character's skinned mesh at the moment of death.
Definition DeathDissolveEffect.hpp:23
Continuous EnergyGun lightning built on the same ArcVertex path as Railgun.
Definition EnergyTeslaArcEffect.hpp:15
Owns the new explosion VFX path for rockets, frags, stickies, and molotovs.
Definition ExplosionVfxEffect.hpp:23
Hitscan energy beam using fBm (fractional Brownian motion) path deviation.
Definition HitscanEffect.hpp:33
Spawns spark bursts + impact flash quads on hit events.
Definition ImpactEffect.hpp:14
Camera for the new renderer, combining view and projection into one matrix.
Definition Camera.hpp:22
Owns all particle GPU pipelines and per-category GPU buffers.
Definition ParticleRenderer.hpp:20
Top-level particle system orchestrator.
Definition ParticleSystem.hpp:39
HitscanEffect hitscan_
Definition ParticleSystem.hpp:186
void debugEnergyTeslaArc(glm::vec3 origin, glm::vec3 guidePoint, glm::vec3 hitPoint, bool locked, float lockStrength)
Spawn a short debug preview of the sustained EnergyGun Tesla arc.
Definition ParticleSystem.cpp:272
float screenW_
Definition ParticleSystem.hpp:203
uint32_t energyTeslaArcVertexCount() const
Definition ParticleSystem.hpp:167
bool init(SDL_GPUDevice *dev, SDL_GPUTextureFormat colorFmt, SDL_GPUShaderFormat shaderFmt)
Initialise all effect sub-systems and the GPU renderer.
Definition ParticleSystem.cpp:21
TeslaBeamEffect tesla_
Definition ParticleSystem.hpp:187
void onWeaponFired(const WeaponFiredEvent &e)
Handle a weapon-fired event (spawns hitscan beam if applicable).
Definition ParticleSystem.cpp:309
uint32_t tracerCount() const
Definition ParticleSystem.hpp:163
void driveGroundFire(entt::entity fieldEntity, glm::vec3 pos, float radius, float remaining, float duration)
Drive molotov ground-fire visuals from a replicated FireField entity.
Definition ParticleSystem.cpp:267
EnergyTeslaArcEffect energyTesla_
Definition ParticleSystem.hpp:188
void drawWorldText(glm::vec3 worldPos, std::string_view text, glm::vec4 color, float worldHeight)
Queue world-space SDF text for this frame.
Definition ParticleSystem.cpp:297
uint32_t explosionSpriteCount() const
Definition ParticleSystem.hpp:171
uint32_t energyTeslaBeamCount() const
Definition ParticleSystem.hpp:168
DeathDissolveEffect death_
Definition ParticleSystem.hpp:193
void spawnExplosionVfx(glm::vec3 pos, glm::vec3 normal, float blastRadius, ExplosionVfxKind kind=ExplosionVfxKind::Rocket)
Spawn a fresh typed explosion VFX profile at pos.
Definition ParticleSystem.cpp:262
void spawnDeathDissolve(const std::vector< glm::vec3 > &worldPoints, glm::vec3 center, glm::vec4 color)
Spawn a "Thanos snap" death dissolve from a character's posed mesh.
Definition ParticleSystem.cpp:290
void quit()
Tear down all GPU resources and effect sub-systems.
Definition ParticleSystem.cpp:57
void drawScreenText(glm::vec2 pixelPos, std::string_view text, glm::vec4 color, float pixelHeight)
Queue screen-space HUD SDF text for this frame.
Definition ParticleSystem.cpp:302
glm::vec3 camRight_
Definition ParticleSystem.hpp:199
void spawnImpactEffect(glm::vec3 pos, glm::vec3 normal, SurfaceType surf, WeaponType wt)
Spawn spark burst + impact flash + bullet hole decal.
Definition ParticleSystem.cpp:234
uint32_t ribbonVertexCount() const
Definition ParticleSystem.hpp:164
ImpactEffect impact_
Definition ParticleSystem.hpp:190
std::vector< ArcVertex > arcScratch_
Definition ParticleSystem.hpp:211
uint32_t impactCount() const
Definition ParticleSystem.hpp:162
void spawnHitscanBeam(glm::vec3 origin, glm::vec3 hitPos, WeaponType wt)
Spawn an instant energy beam from origin to hitPos.
Definition ParticleSystem.cpp:229
bool sdfReady() const
Definition ParticleSystem.hpp:174
RibbonTrail ribbons_
Definition ParticleSystem.hpp:185
void spawnBulletHole(glm::vec3 pos, glm::vec3 normal, WeaponType wt)
Place a bullet-hole decal on a surface.
Definition ParticleSystem.cpp:242
void spawnSmoke(glm::vec3 pos, float radius)
Spawn a smoke cloud at pos.
Definition ParticleSystem.cpp:247
uint32_t smokeCount() const
Definition ParticleSystem.hpp:170
uint32_t explosionDebrisCount() const
Definition ParticleSystem.hpp:172
void setLocalEnergyBeamOriginOverride(glm::vec3 origin)
Override the local EnergyGun beam origin with the first-person muzzle marker.
Definition ParticleSystem.hpp:136
glm::vec3 camUp_
Definition ParticleSystem.hpp:200
void driveRocketSmokeTrails(float dt, Registry ®)
Emit short smoke puffs behind live rocket projectile entities.
Definition ParticleSystem.cpp:124
bool localEnergyBeamOriginOverrideValid_
Definition ParticleSystem.hpp:202
ExplosionVfxEffect explosionVfx_
Definition ParticleSystem.hpp:192
void debugEnergyTeslaPreview(glm::vec3 origin, glm::vec3 guidePoint, glm::vec3 hitPoint, bool locked, float lockStrength)
Definition ParticleSystem.cpp:281
float frameDt_
Definition ParticleSystem.hpp:206
SdfRenderer sdf_
Definition ParticleSystem.hpp:194
void spawnFire(glm::vec3 pos, float radius)
Spawn a one-shot fire puff at pos (orange/red flame billboards).
Definition ParticleSystem.cpp:252
void spawnBulletTracer(glm::vec3 origin, glm::vec3 dir, float range=500.f)
Spawn a one-shot bullet-tracer streak (no ECS entity needed).
Definition ParticleSystem.cpp:224
TracerEffect tracers_
Definition ParticleSystem.hpp:184
SmokeEffect smoke_
Definition ParticleSystem.hpp:189
std::unordered_map< entt::entity, float > rocketSmokeAccumulators_
Definition ParticleSystem.hpp:208
glm::vec3 localEnergyBeamOriginOverride_
Definition ParticleSystem.hpp:201
float screenH_
Definition ParticleSystem.hpp:204
uint32_t arcVertexCount() const
Definition ParticleSystem.hpp:169
ParticleRenderer renderer_
Definition ParticleSystem.hpp:183
void onExplosion(const ExplosionEvent &e)
Handle an explosion event (spawns explosion and smoke).
Definition ParticleSystem.cpp:320
void update(float dt, const NewCamera &cam, Registry ®)
Simulate all effects. Called once per render frame (not per physics tick).
Definition ParticleSystem.cpp:65
uint32_t railgunArcVertexCount() const
Definition ParticleSystem.hpp:166
uint32_t decalCount() const
Definition ParticleSystem.hpp:173
void setScreenSize(float w, float h)
Set screen dimensions for HUD rendering. Call before render().
Definition ParticleSystem.hpp:125
void clearLocalEnergyBeamOriginOverride()
Clear the local EnergyGun beam origin override for this frame.
Definition ParticleSystem.hpp:143
void render(SDL_GPURenderPass *pass, SDL_GPUCommandBuffer *cmd)
Issue all particle draw calls. Must be called INSIDE a render pass.
Definition ParticleSystem.cpp:203
void spawnRibbonTrail(entt::entity e, Registry ®)
Attach a ribbon trail to a slow/arcing projectile entity (rocket).
Definition ParticleSystem.cpp:218
void uploadToGpu(SDL_GPUCommandBuffer *cmd)
Upload all particle data to GPU. Must be called BEFORE render pass.
Definition ParticleSystem.cpp:162
void spawnExplosion(glm::vec3 pos, float blastRadius)
Spawn rocket explosion at pos.
Definition ParticleSystem.cpp:257
glm::vec3 camPos_
Definition ParticleSystem.hpp:197
BulletHoleDecal decals_
Definition ParticleSystem.hpp:191
glm::vec3 camForward_
Definition ParticleSystem.hpp:198
void spawnProjectileTracer(entt::entity e, Registry ®)
Attach an oriented-capsule tracer to a fast-bullet projectile entity.
Definition ParticleSystem.cpp:210
uint32_t hitscanBeamCount() const
Definition ParticleSystem.hpp:165
void onImpact(const ProjectileImpactEvent &e)
Handle a projectile impact event (spawns sparks and decal).
Definition ParticleSystem.cpp:315
const SdfAtlas & sdfAtlas() const
Access the SDF atlas for shared use by the HUD system.
Definition ParticleSystem.hpp:177
Builds camera-facing ribbon trails for slow/arcing projectiles (rockets).
Definition RibbonTrail.hpp:17
Loads a TTF font, bakes an SDF glyph atlas, and uploads it to the GPU.
Definition SdfAtlas.hpp:18
Queues SDF glyph quads for world-space and screen-space text.
Definition SdfRenderer.hpp:18
Manages volumetric smoke billboard particles.
Definition SmokeEffect.hpp:20
Sustained curved energy-arc beams, keyed by owner entity id.
Definition TeslaBeamEffect.hpp:29
Manages oriented-capsule tracers for fast-bullet projectile entities.
Definition TracerEffect.hpp:20
Emitted when a rocket/grenade explodes.
Definition ParticleEvents.hpp:34
Emitted when a projectile or hitscan hits a surface.
Definition ParticleEvents.hpp:25
Emitted when a weapon fires (both hitscan and projectile).
Definition ParticleEvents.hpp:13