raisin::ExplosionEffectSettings
struct · #include <rayrai/ExplosionEffects.hpp>
How the window draws explosions and projectiles (RayraiWindow::setExplosionEffectSettings()).
An explosion is a fireball that flashes white-hot, swells and cools through orange to dull red, a cloud of smoke that rises and spreads for several seconds, sparks and debris thrown out of it and a flash of light on its surroundings. A charge on the ground also throws up a column of earth and dust that spreads along the ground, clods that fall back, and leaves a scorch mark; one at a water surface throws up spray instead. Sizes and durations scale with the cube root of the charge, as the blast does. Smoke, dust and debris are lit by the window's main light like the scene around them.
Public attributes
enabled
bool enabledDraw explosions, muzzle flashes, impacts and tracers.
sizeScale
float sizeScaleMultiplies the size of fireballs and smoke clouds, > 0.
smokeLifetime
float smokeLifetimeSeconds the smoke of a 1 kg charge lasts, > 0.
marchSteps
int marchStepsSamples per pixel through fire and smoke, [8, 64].
volumeDownsample
int volumeDownsampleFire and smoke are marched at 1/n of the image's width and height and blended into the image along its depth, so that they stay behind what stands in front of them, [1, 4]. At 2 they cost about a quarter of 1, whose cost grows with the screen they cover: a smoke screen across the view at full resolution can take longer than the rest of the frame.
sparks
bool sparksThrow sparks, debris and dust.
flashLight
bool flashLightLight the surroundings with the fireball (one additional light).
scorchMarks
bool scorchMarksLeave scorch marks under ground bursts (projected decals).
scorchLifetime
float scorchLifetimeSeconds a scorch mark stays before it fades, > 0.
tracers
bool tracersDraw glowing streaks behind projectiles in flight.
useWorldTime
bool useWorldTimeAnimate with the shown world's time (World::getWorldTime()), so effects pause and rewind with the simulation and sensor images are reproducible; false animates with the wall clock, for a window whose world does not advance.
smokeColor
glm::vec3 smokeColorAlbedo of the smoke of the shown world's explosions (linear RGB); addExplosionEffect() takes the effect's own.
dustColor
glm::vec3 dustColorAlbedo of the earth and dust the shown world's ground bursts throw up (linear RGB).