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

Spawns spark bursts + impact flash quads on hit events. More...

#include <ImpactEffect.hpp>

Collaboration diagram for ImpactEffect:
[legend]

Public Member Functions

void update (float dt)
 Advance spark physics and fade alpha over time.
void spawn (glm::vec3 pos, glm::vec3 normal, SurfaceType surface, float frameDt)
 Spawn 8-16 sparks + 1 flash at the impact point.
const BillboardParticledata () const
uint32_t count () const

Private Attributes

ParticlePool< BillboardParticle, 4096 > pool_

Detailed Description

Spawns spark bursts + impact flash quads on hit events.

Member Function Documentation

◆ count()

uint32_t ImpactEffect::count ( ) const
inlinenodiscard

◆ data()

const BillboardParticle * ImpactEffect::data ( ) const
inlinenodiscard

◆ spawn()

void ImpactEffect::spawn ( glm::vec3 pos,
glm::vec3 normal,
SurfaceType surface,
float frameDt )

Spawn 8-16 sparks + 1 flash at the impact point.

Parameters
posWorld-space impact position.
normalSurface normal at the impact point.
surfaceSurface material type controlling spark appearance.
frameDtCurrent frame delta time, used for single-frame flash lifetime.
Here is the call graph for this function:

◆ update()

void ImpactEffect::update ( float dt)

Advance spark physics and fade alpha over time.

Member Data Documentation

◆ pool_

ParticlePool<BillboardParticle, 4096> ImpactEffect::pool_
private

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