pub struct ParticleEmitter { /* private fields */ }Expand description
A point emitter that continuously (or in bursts) spawns particles,
integrates their motion, and records them into a DrawList as colored
circles whose color and size interpolate over each particle’s lifetime.
Implementations§
Source§impl ParticleEmitter
Implements creation, simulation, and rendering for ParticleEmitter.
impl ParticleEmitter
Implements creation, simulation, and rendering for ParticleEmitter.
Sourcepub fn create(position: Vector2D, config: ParticleConfig) -> ParticleEmitter
pub fn create(position: Vector2D, config: ParticleConfig) -> ParticleEmitter
Sourcepub fn with_defaults(position: Vector2D) -> ParticleEmitter
pub fn with_defaults(position: Vector2D) -> ParticleEmitter
Sourcepub fn update(&mut self, delta_time: f64)
pub fn update(&mut self, delta_time: f64)
Advances the emitter by the given delta time: spawns new particles from the emission budget while active, integrates motion and gravity, and removes expired particles.
§Arguments
f64- The time elapsed since the last update, in seconds.
Sourcepub fn burst(&mut self, count: usize)
pub fn burst(&mut self, count: usize)
Spawns the given number of particles immediately, regardless of the active flag, clamped to the remaining particle capacity.
§Arguments
usize- The number of particles to spawn.
Sourcepub fn render(&self, draw_list: &mut DrawList)
pub fn render(&self, draw_list: &mut DrawList)
Records all live particles into the given draw list as filled circles.
Each particle’s color and radius are interpolated between the configured start and end values by its normalized age.
§Arguments
&mut DrawList- The draw list to record commands into.
Sourcepub fn alive_count(&self) -> usize
pub fn alive_count(&self) -> usize
Source§impl ParticleEmitter
impl ParticleEmitter
pub fn get_mut_config(&mut self) -> &mut ParticleConfig
pub fn get_active(&self) -> bool
pub fn get_mut_active(&mut self) -> &mut bool
Source§impl ParticleEmitter
impl ParticleEmitter
pub fn new(position: Vector2D, config: ParticleConfig) -> Self
Trait Implementations§
Source§impl Clone for ParticleEmitter
impl Clone for ParticleEmitter
Source§fn clone(&self) -> ParticleEmitter
fn clone(&self) -> ParticleEmitter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParticleEmitter
impl Debug for ParticleEmitter
Source§impl PartialEq for ParticleEmitter
impl PartialEq for ParticleEmitter
impl StructuralPartialEq for ParticleEmitter
Source§impl Updatable for ParticleEmitter
Forwards ParticleEmitter::update through the Updatable trait so
emitters can participate in the same generic update loop as entities,
animators, scenes, and physics worlds.
impl Updatable for ParticleEmitter
Forwards ParticleEmitter::update through the Updatable trait so
emitters can participate in the same generic update loop as entities,
animators, scenes, and physics worlds.