|
group2 0.1.0
CSE 125 Group 2
|
One-shot disintegration effect spawned from a character's skinned mesh at the moment of death. More...
#include <DeathDissolveEffect.hpp>
Classes | |
| struct | Particle |
| Full CPU simulation state for one dissolve particle. More... | |
Public Member Functions | |
| void | spawn (const std::vector< glm::vec3 > &worldPoints, glm::vec3 center, glm::vec4 baseColor) |
| Spawn a dissolve from posed mesh points. | |
| void | update (float dt) |
| Advance the simulation and rebuild the GPU billboard array. | |
| const BillboardParticle * | data () const |
| Live particle data for upload (rebuilt each update). | |
| uint32_t | count () const |
Private Attributes | |
| std::vector< Particle > | particles_ |
| std::vector< BillboardParticle > | gpu_ |
| Rebuilt every frame for upload. | |
Static Private Attributes | |
| static constexpr uint32_t | k_maxParticles = 30000 |
One-shot disintegration effect spawned from a character's skinned mesh at the moment of death.
The caller samples the dead character's posed mesh into world-space points (see Game's death-capture pass) and hands them to spawn. Each point becomes a particle that holds at its mesh position for a short, position- dependent delay (producing a sweeping dissolve wave), then peels off along a wind direction, drifts, and fades. Particles are alpha-blended camera-facing billboards rendered through the shared particle-billboard shaders.
|
inlinenodiscard |
|
inlinenodiscard |
Live particle data for upload (rebuilt each update).
| void DeathDissolveEffect::spawn | ( | const std::vector< glm::vec3 > & | worldPoints, |
| glm::vec3 | center, | ||
| glm::vec4 | baseColor ) |
Spawn a dissolve from posed mesh points.
| worldPoints | World-space positions sampled from the death pose. |
| center | Body center (world) — drives the radial/sweep basis. |
| baseColor | Particle tint (mesh has no texture; ~light grey). |
| void DeathDissolveEffect::update | ( | float | dt | ) |
Advance the simulation and rebuild the GPU billboard array.
|
private |
Rebuilt every frame for upload.
|
staticconstexprprivate |
|
private |