group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
ExplosionEffect.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
9
10#include <glm/glm.hpp>
11
16{
17public:
19 void update(float dt);
20
25 void spawn(glm::vec3 pos, float blastRadius, SmokeEffect& smoke);
26
27 // Shockwave ring particles
28 [[nodiscard]] const BillboardParticle* ringData() const { return ringPool_.rawData(); }
29 [[nodiscard]] uint32_t ringCount() const { return ringPool_.liveCount(); }
30
31private:
32 // We need a separate pool for shockwave rings — different render behaviour from sparks
33 // but same BillboardParticle struct (size drives ring scale, color encodes ring vs disc).
35
37 struct PendingSmoke
38 {
39 glm::vec3 pos;
40 float radius;
41 float delay;
42 bool isFire;
43 };
44 // Holds deferred smoke/fire spawns
45 static constexpr int k_maxPending = 32;
46 PendingSmoke pending_[k_maxPending]{};
47 int pendingCount_ = 0;
48};
Fixed-capacity particle pool with O(1) swap-remove.
GPU-uploadable particle structs for all effect categories.
Volumetric smoke billboard particle manager with back-to-front sorting.
Spawns shockwave ring + fireball + smoke cloud for rocket explosions.
Definition ExplosionEffect.hpp:16
void update(float dt)
Advance ring animations and tick deferred smoke timers.
Definition ExplosionEffect.cpp:29
void spawn(glm::vec3 pos, float blastRadius, SmokeEffect &smoke)
Spawn a full explosion at pos with given blast radius.
Definition ExplosionEffect.cpp:8
const BillboardParticle * ringData() const
Definition ExplosionEffect.hpp:28
uint32_t ringCount() const
Definition ExplosionEffect.hpp:29
Manages volumetric smoke billboard particles.
Definition SmokeEffect.hpp:20
Single billboard particle (sparks, impact flash, shockwave ring).
Definition ParticleTypes.hpp:12
Fixed-capacity particle pool with O(1) swap-remove.
Definition ParticlePool.hpp:22
const T * rawData() const
Pointer to the contiguous live data for GPU upload.
Definition ParticlePool.hpp:48
uint32_t liveCount() const
Definition ParticlePool.hpp:49