Manages volumetric smoke billboard particles.
More...
#include <SmokeEffect.hpp>
|
| void | update (float dt, Registry ®istry, 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 SmokeParticle * | data () const |
| uint32_t | count () const |
|
| static constexpr float | k_upDrift = 18.f |
| | Upward drift speed (world units/s).
|
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.
◆ count()
| uint32_t SmokeEffect::count |
( |
| ) |
const |
|
inlinenodiscard |
◆ data()
◆ 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
-
| pos | World-space center of the smoke cluster. |
| radius | Spread radius for particle placement. |
| isFire | If true, spawn fire-colored particles instead of grey smoke. |
◆ spawnTrailPuff()
| void SmokeEffect::spawnTrailPuff |
( |
glm::vec3 | pos, |
|
|
float | radius ) |
Spawn a compact, short-lived smoke puff for rocket trails.
◆ update()
| void SmokeEffect::update |
( |
float | dt, |
|
|
Registry & | registry, |
|
|
glm::vec3 | camPos, |
|
|
glm::vec3 | camForward ) |
Simulate particles, drive continuous emitters, and sort for rendering.
- Parameters
-
| dt | Frame delta time in seconds. |
| registry | ECS registry containing ParticleEmitterTag entities. |
| camPos | World-space camera position for depth sorting. |
| camForward | Camera forward vector for depth sorting. |
◆ k_upDrift
| float SmokeEffect::k_upDrift = 18.f |
|
staticconstexprprivate |
Upward drift speed (world units/s).
◆ pool_
◆ sorted_
Back-to-front sorted copy for upload.
The documentation for this class was generated from the following files: