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

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 BillboardParticledata () const
 Live particle data for upload (rebuilt each update).
uint32_t count () const

Private Attributes

std::vector< Particleparticles_
std::vector< BillboardParticlegpu_
 Rebuilt every frame for upload.

Static Private Attributes

static constexpr uint32_t k_maxParticles = 30000

Detailed Description

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.

Member Function Documentation

◆ count()

uint32_t DeathDissolveEffect::count ( ) const
inlinenodiscard

◆ data()

const BillboardParticle * DeathDissolveEffect::data ( ) const
inlinenodiscard

Live particle data for upload (rebuilt each update).

◆ spawn()

void DeathDissolveEffect::spawn ( const std::vector< glm::vec3 > & worldPoints,
glm::vec3 center,
glm::vec4 baseColor )

Spawn a dissolve from posed mesh points.

Parameters
worldPointsWorld-space positions sampled from the death pose.
centerBody center (world) — drives the radial/sweep basis.
baseColorParticle tint (mesh has no texture; ~light grey).

◆ update()

void DeathDissolveEffect::update ( float dt)

Advance the simulation and rebuild the GPU billboard array.

Member Data Documentation

◆ gpu_

std::vector<BillboardParticle> DeathDissolveEffect::gpu_
private

Rebuilt every frame for upload.

◆ k_maxParticles

uint32_t DeathDissolveEffect::k_maxParticles = 30000
staticconstexprprivate

◆ particles_

std::vector<Particle> DeathDissolveEffect::particles_
private

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