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

Manages volumetric smoke billboard particles. More...

#include <SmokeEffect.hpp>

Collaboration diagram for SmokeEffect:
[legend]

Public Member Functions

void update (float dt, Registry &registry, glm::vec3 camPos, glm::vec3 camForward)
 Simulate particles, drive continuous emitters, and sort for rendering.
void spawn (glm::vec3 pos, float radius, bool isFire=false)
 Spawn a cluster of smoke puffs at pos with the given radius.
void spawnTrailPuff (glm::vec3 pos, float radius)
 Spawn a compact, short-lived smoke puff for rocket trails.
const SmokeParticledata () const
uint32_t count () const

Private Attributes

ParticlePool< SmokeParticle, 1024 > pool_
std::vector< SmokeParticlesorted_
 Back-to-front sorted copy for upload.

Static Private Attributes

static constexpr float k_upDrift = 18.f
 Upward drift speed (world units/s).

Detailed Description

Manages volumetric smoke billboard particles.

Provides spawn() for one-shot smoke puffs and also drives ParticleEmitterTag entities continuously in update().

Particles are sorted back-to-front before upload for correct alpha blending.

Member Function Documentation

◆ count()

uint32_t SmokeEffect::count ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ data()

const SmokeParticle * SmokeEffect::data ( ) const
inlinenodiscard

◆ spawn()

void SmokeEffect::spawn ( glm::vec3 pos,
float radius,
bool isFire = false )

Spawn a cluster of smoke puffs at pos with the given radius.

Parameters
posWorld-space center of the smoke cluster.
radiusSpread radius for particle placement.
isFireIf true, spawn fire-colored particles instead of grey smoke.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ spawnTrailPuff()

void SmokeEffect::spawnTrailPuff ( glm::vec3 pos,
float radius )

Spawn a compact, short-lived smoke puff for rocket trails.

Here is the call graph for this function:

◆ update()

void SmokeEffect::update ( float dt,
Registry & registry,
glm::vec3 camPos,
glm::vec3 camForward )

Simulate particles, drive continuous emitters, and sort for rendering.

Parameters
dtFrame delta time in seconds.
registryECS registry containing ParticleEmitterTag entities.
camPosWorld-space camera position for depth sorting.
camForwardCamera forward vector for depth sorting.
Here is the call graph for this function:

Member Data Documentation

◆ k_upDrift

float SmokeEffect::k_upDrift = 18.f
staticconstexprprivate

Upward drift speed (world units/s).

◆ pool_

ParticlePool<SmokeParticle, 1024> SmokeEffect::pool_
private

◆ sorted_

std::vector<SmokeParticle> SmokeEffect::sorted_
private

Back-to-front sorted copy for upload.


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