Skip to content

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 ​

cpp
bool enabled

Draw explosions, muzzle flashes, impacts and tracers.

sizeScale ​

cpp
float sizeScale

Multiplies the size of fireballs and smoke clouds, > 0.

smokeLifetime ​

cpp
float smokeLifetime

Seconds the smoke of a 1 kg charge lasts, > 0.

marchSteps ​

cpp
int marchSteps

Samples per pixel through fire and smoke, [8, 64].

volumeDownsample ​

cpp
int volumeDownsample

Fire 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 ​

cpp
bool sparks

Throw sparks, debris and dust.

flashLight ​

cpp
bool flashLight

Light the surroundings with the fireball (one additional light).

scorchMarks ​

cpp
bool scorchMarks

Leave scorch marks under ground bursts (projected decals).

scorchLifetime ​

cpp
float scorchLifetime

Seconds a scorch mark stays before it fades, > 0.

tracers ​

cpp
bool tracers

Draw glowing streaks behind projectiles in flight.

useWorldTime ​

cpp
bool useWorldTime

Animate 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 ​

cpp
glm::vec3 smokeColor

Albedo of the smoke of the shown world's explosions (linear RGB); addExplosionEffect() takes the effect's own.

dustColor ​

cpp
glm::vec3 dustColor

Albedo of the earth and dust the shown world's ground bursts throw up (linear RGB).

RaiSim — physics for robotics and AI.