20#include <entt/entt.hpp>
42 bool init(SDL_GPUDevice* dev, SDL_GPUTextureFormat colorFmt, SDL_GPUShaderFormat shaderFmt);
74 void spawnFire(glm::vec3 pos,
float radius);
86 void drawWorldText(glm::vec3 worldPos, std::string_view text, glm::vec4 color,
float worldHeight);
93 void drawScreenText(glm::vec2 pixelPos, std::string_view text, glm::vec4 color,
float pixelHeight);
111 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.
Shockwave ring and fireball explosion effect for rocket impacts.
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.
Projectile component and weapon/surface type enumerations.
SurfaceType
Surface material hit by a projectile — drives impact effect parameters.
Definition Projectile.hpp:14
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.
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
Spawns shockwave ring + fireball + smoke cloud for rocket explosions.
Definition ExplosionEffect.hpp:16
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:10
Owns all particle GPU pipelines and per-category GPU buffers.
Definition ParticleRenderer.hpp:20
Top-level particle system orchestrator.
Definition ParticleSystem.hpp:35
HitscanEffect hitscan_
Definition ParticleSystem.hpp:140
float screenW_
Definition ParticleSystem.hpp:152
bool init(SDL_GPUDevice *dev, SDL_GPUTextureFormat colorFmt, SDL_GPUShaderFormat shaderFmt)
Initialise all effect sub-systems and the GPU renderer.
Definition ParticleSystem.cpp:13
void onWeaponFired(const WeaponFiredEvent &e)
Handle a weapon-fired event (spawns hitscan beam if applicable).
Definition ParticleSystem.cpp:170
uint32_t tracerCount() const
Definition ParticleSystem.hpp:125
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:158
void quit()
Tear down all GPU resources and effect sub-systems.
Definition ParticleSystem.cpp:46
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:163
glm::vec3 camRight_
Definition ParticleSystem.hpp:150
void spawnImpactEffect(glm::vec3 pos, glm::vec3 normal, SurfaceType surf, WeaponType wt)
Spawn spark burst + impact flash + bullet hole decal.
Definition ParticleSystem.cpp:128
uint32_t ribbonVertexCount() const
Definition ParticleSystem.hpp:126
ImpactEffect impact_
Definition ParticleSystem.hpp:142
uint32_t impactCount() const
Definition ParticleSystem.hpp:124
void spawnHitscanBeam(glm::vec3 origin, glm::vec3 hitPos, WeaponType wt)
Spawn an instant energy beam from origin to hitPos.
Definition ParticleSystem.cpp:123
bool sdfReady() const
Definition ParticleSystem.hpp:131
RibbonTrail ribbons_
Definition ParticleSystem.hpp:139
void spawnBulletHole(glm::vec3 pos, glm::vec3 normal, WeaponType wt)
Place a bullet-hole decal on a surface.
Definition ParticleSystem.cpp:136
void spawnSmoke(glm::vec3 pos, float radius)
Spawn a smoke cloud at pos.
Definition ParticleSystem.cpp:141
uint32_t smokeCount() const
Definition ParticleSystem.hpp:129
glm::vec3 camUp_
Definition ParticleSystem.hpp:151
float frameDt_
Definition ParticleSystem.hpp:155
SdfRenderer sdf_
Definition ParticleSystem.hpp:145
void spawnFire(glm::vec3 pos, float radius)
Spawn a one-shot fire puff at pos (orange/red flame billboards).
Definition ParticleSystem.cpp:146
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:117
TracerEffect tracers_
Definition ParticleSystem.hpp:138
SmokeEffect smoke_
Definition ParticleSystem.hpp:141
float screenH_
Definition ParticleSystem.hpp:153
uint32_t arcVertexCount() const
Definition ParticleSystem.hpp:128
ParticleRenderer renderer_
Definition ParticleSystem.hpp:137
void onExplosion(const ExplosionEvent &e)
Handle an explosion event (spawns explosion and smoke).
Definition ParticleSystem.cpp:181
void update(float dt, const NewCamera &cam, Registry ®)
Simulate all effects. Called once per render frame (not per physics tick).
Definition ParticleSystem.cpp:54
uint32_t decalCount() const
Definition ParticleSystem.hpp:130
void setScreenSize(float w, float h)
Set screen dimensions for HUD rendering. Call before render().
Definition ParticleSystem.hpp:98
ExplosionEffect explosions_
Definition ParticleSystem.hpp:144
void render(SDL_GPURenderPass *pass, SDL_GPUCommandBuffer *cmd)
Issue all particle draw calls. Must be called INSIDE a render pass.
Definition ParticleSystem.cpp:96
void spawnRibbonTrail(entt::entity e, Registry ®)
Attach a ribbon trail to a slow/arcing projectile entity (rocket).
Definition ParticleSystem.cpp:111
void uploadToGpu(SDL_GPUCommandBuffer *cmd)
Upload all particle data to GPU. Must be called BEFORE render pass.
Definition ParticleSystem.cpp:81
void spawnExplosion(glm::vec3 pos, float blastRadius)
Spawn rocket explosion at pos.
Definition ParticleSystem.cpp:151
glm::vec3 camPos_
Definition ParticleSystem.hpp:148
BulletHoleDecal decals_
Definition ParticleSystem.hpp:143
glm::vec3 camForward_
Definition ParticleSystem.hpp:149
void spawnProjectileTracer(entt::entity e, Registry ®)
Attach an oriented-capsule tracer to a fast-bullet projectile entity.
Definition ParticleSystem.cpp:103
uint32_t hitscanBeamCount() const
Definition ParticleSystem.hpp:127
void onImpact(const ProjectileImpactEvent &e)
Handle a projectile impact event (spawns sparks and decal).
Definition ParticleSystem.cpp:176
const SdfAtlas & sdfAtlas() const
Access the SDF atlas for shared use by the HUD system.
Definition ParticleSystem.hpp:134
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
Manages oriented-capsule tracers for fast-bullet projectile entities.
Definition TracerEffect.hpp:18
Emitted when a rocket/grenade explodes.
Definition ParticleEvents.hpp:33
Emitted when a projectile or hitscan hits a surface.
Definition ParticleEvents.hpp:24
Emitted when a weapon fires (both hitscan and projectile).
Definition ParticleEvents.hpp:13