Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::render::EmitterConfig Struct Reference

How an emitter spawns its particles, and how they change over their life. More...

#include <aegis2d/render/particles.hpp>

Public Attributes

float rate = 50.0F
 Particles spawned per second while emitting; 0 for bursts only.
 
Range lifetime {.min = 1.0F, .max = 1.0F}
 Life of each particle, in seconds.
 
Range speed {.min = 50.0F, .max = 100.0F}
 Speed of each particle at its birth, in logical pixels per second.
 
float direction = 0.0F
 Middle of the directions particles leave in, in radians: 0 to the right, pi / 2 down (y grows downwards on screen).
 
float spread = 2.0F * std::numbers::pi_v<float>
 Width of the cone of directions around direction, in radians: 0 for a straight jet, 2 pi for every direction.
 
float start_size = 4.0F
 Side of a particle at its birth, in logical pixels.
 
float end_size = 0.0F
 Side of a particle at the end of its life.
 
Color start_color = rgb(0xFFD166)
 Color at its birth.
 
Color end_color = rgb(0xEF476F, 0.0F)
 Color at the end of its life, such as transparent to fade out.
 
std::size_t max_particles = 1000
 Most particles alive at once; spawns past it are dropped.
 

Detailed Description

How an emitter spawns its particles, and how they change over their life.

Member Data Documentation

◆ direction

float aegis2d::render::EmitterConfig::direction = 0.0F

Middle of the directions particles leave in, in radians: 0 to the right, pi / 2 down (y grows downwards on screen).

◆ end_color

Color aegis2d::render::EmitterConfig::end_color = rgb(0xEF476F, 0.0F)

Color at the end of its life, such as transparent to fade out.

◆ end_size

float aegis2d::render::EmitterConfig::end_size = 0.0F

Side of a particle at the end of its life.

◆ lifetime

Range aegis2d::render::EmitterConfig::lifetime {.min = 1.0F, .max = 1.0F}

Life of each particle, in seconds.

◆ max_particles

std::size_t aegis2d::render::EmitterConfig::max_particles = 1000

Most particles alive at once; spawns past it are dropped.

◆ rate

float aegis2d::render::EmitterConfig::rate = 50.0F

Particles spawned per second while emitting; 0 for bursts only.

◆ speed

Range aegis2d::render::EmitterConfig::speed {.min = 50.0F, .max = 100.0F}

Speed of each particle at its birth, in logical pixels per second.

◆ spread

float aegis2d::render::EmitterConfig::spread = 2.0F * std::numbers::pi_v<float>

Width of the cone of directions around direction, in radians: 0 for a straight jet, 2 pi for every direction.

◆ start_color

Color aegis2d::render::EmitterConfig::start_color = rgb(0xFFD166)

Color at its birth.

◆ start_size

float aegis2d::render::EmitterConfig::start_size = 4.0F

Side of a particle at its birth, in logical pixels.


The documentation for this struct was generated from the following file: