pub struct ParticleConfig {
pub emission_rate: f64,
pub max_particles: usize,
pub lifetime_min: f64,
pub lifetime_max: f64,
pub speed_min: f64,
pub speed_max: f64,
pub gravity: Vector2D,
pub size_start: f64,
pub size_end: f64,
/* private fields */
}Expand description
The static configuration of a particle emitter, describing how new particles are spawned and how they evolve over their lifetime.
Every field is publicly settable, so a caller composes a config by
starting from ParticleConfig::default and overriding the tunables it
cares about before handing it to ParticleEmitter::create.
Fields§
§emission_rate: f64The number of particles spawned per second while the emitter is active.
max_particles: usizeThe maximum number of simultaneously live particles.
lifetime_min: f64The minimum particle lifetime in seconds.
lifetime_max: f64The maximum particle lifetime in seconds.
speed_min: f64The minimum initial particle speed in world units per second.
speed_max: f64The maximum initial particle speed in world units per second.
gravity: Vector2DThe constant acceleration applied to every live particle.
size_start: f64The particle radius at birth in world units.
size_end: f64The particle radius at death in world units.
Implementations§
Source§impl ParticleConfig
impl ParticleConfig
pub fn set_emission_rate(&mut self, val: f64) -> &mut Self
pub fn get_mut_max_particles(&mut self) -> &mut usize
pub fn set_max_particles(&mut self, val: usize) -> &mut Self
pub fn get_lifetime_min(&self) -> f64
pub fn get_mut_lifetime_min(&mut self) -> &mut f64
pub fn set_lifetime_min(&mut self, val: f64) -> &mut Self
pub fn get_lifetime_max(&self) -> f64
pub fn set_lifetime_max(&mut self, val: f64) -> &mut Self
pub fn set_speed_min(&mut self, val: f64) -> &mut Self
pub fn set_speed_max(&mut self, val: f64) -> &mut Self
pub fn set_gravity(&mut self, val: Vector2D) -> &mut Self
pub fn set_size_start(&mut self, val: f64) -> &mut Self
pub fn set_size_end(&mut self, val: f64) -> &mut Self
Trait Implementations§
Source§impl Clone for ParticleConfig
impl Clone for ParticleConfig
impl Copy for ParticleConfig
Source§impl Debug for ParticleConfig
impl Debug for ParticleConfig
Source§impl Default for ParticleConfig
Implements Default for ParticleConfig with sensible engine defaults.
impl Default for ParticleConfig
Implements Default for ParticleConfig with sensible engine defaults.
Source§fn default() -> ParticleConfig
fn default() -> ParticleConfig
Constructs a default ParticleConfig value.
§Returns
ParticleConfig- A default-constructed instance with the documented initial state.