group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
ExplosionEffect Class Reference

Spawns shockwave ring + fireball + smoke cloud for rocket explosions. More...

#include <ExplosionEffect.hpp>

Collaboration diagram for ExplosionEffect:
[legend]

Classes

struct  PendingSmoke
 Deferred smoke or fire spawn scheduled after the initial explosion. More...

Public Member Functions

void update (float dt)
 Advance ring animations and tick deferred smoke timers.
void spawn (glm::vec3 pos, float blastRadius, SmokeEffect &smoke)
 Spawn a full explosion at pos with given blast radius.
const BillboardParticleringData () const
uint32_t ringCount () const

Private Attributes

ParticlePool< BillboardParticle, 64 > ringPool_
PendingSmoke pending_ [k_maxPending] {}
int pendingCount_ = 0

Static Private Attributes

static constexpr int k_maxPending = 32

Detailed Description

Spawns shockwave ring + fireball + smoke cloud for rocket explosions.

Reuses BillboardParticle for the shockwave ring and SmokeEffect for fire/smoke.

Member Function Documentation

◆ ringCount()

uint32_t ExplosionEffect::ringCount ( ) const
inlinenodiscard

◆ ringData()

const BillboardParticle * ExplosionEffect::ringData ( ) const
inlinenodiscard

◆ spawn()

void ExplosionEffect::spawn ( glm::vec3 pos,
float blastRadius,
SmokeEffect & smoke )

Spawn a full explosion at pos with given blast radius.

Parameters
posWorld-space center of the explosion.
blastRadiusRadius controlling ring size and smoke spread.
smokeSmokeEffect instance used to spawn fire and smoke puffs.
Here is the call graph for this function:

◆ update()

void ExplosionEffect::update ( float dt)

Advance ring animations and tick deferred smoke timers.

Member Data Documentation

◆ k_maxPending

int ExplosionEffect::k_maxPending = 32
staticconstexprprivate

◆ pending_

PendingSmoke ExplosionEffect::pending_[k_maxPending] {}
private

◆ pendingCount_

int ExplosionEffect::pendingCount_ = 0
private

◆ ringPool_

ParticlePool<BillboardParticle, 64> ExplosionEffect::ringPool_
private

The documentation for this class was generated from the following files: