pub struct VecParticleSystem<P, E> { /* private fields */ }Expand description
A base particle system using vectors to store the particles and emitters
This should suffice for most particle system needs
Trait Implementations§
Source§impl<P: Clone, E: Clone> Clone for VecParticleSystem<P, E>
impl<P: Clone, E: Clone> Clone for VecParticleSystem<P, E>
Source§fn clone(&self) -> VecParticleSystem<P, E>
fn clone(&self) -> VecParticleSystem<P, E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<P, E> Default for VecParticleSystem<P, E>
impl<P, E> Default for VecParticleSystem<P, E>
Source§impl<P: Particle, E: ParticleEmitter<ParticleType = P>> ParticleSystem for VecParticleSystem<P, E>
impl<P: Particle, E: ParticleEmitter<ParticleType = P>> ParticleSystem for VecParticleSystem<P, E>
Source§type ParticleType = P
type ParticleType = P
This system can hold any particle that implements Particle with the same Coordinate type
Source§type EmitterType = E
type EmitterType = E
This system can hold any emitter that emits any particle that implements Particle with the same Coordinate type
Source§fn iter_particles(&self) -> impl Iterator<Item = &Self::ParticleType>
fn iter_particles(&self) -> impl Iterator<Item = &Self::ParticleType>
Returns an iterator over all currently alive particles in the system
Source§fn iter_particles_mut(
&mut self,
) -> impl Iterator<Item = &mut Self::ParticleType>
fn iter_particles_mut( &mut self, ) -> impl Iterator<Item = &mut Self::ParticleType>
Returns a mutable iterator over all currently alive particles in the system
Source§fn iter_emitters(&self) -> impl Iterator<Item = &Self::EmitterType>
fn iter_emitters(&self) -> impl Iterator<Item = &Self::EmitterType>
Returns an iterator over all currently alive particle emitters in the system
Source§fn iter_emitters_mut(&mut self) -> impl Iterator<Item = &mut Self::EmitterType>
fn iter_emitters_mut(&mut self) -> impl Iterator<Item = &mut Self::EmitterType>
Returns a mutable iterator over all currently alive particle emitters in the system
Source§fn add_particle(&mut self, particle: Self::ParticleType)
fn add_particle(&mut self, particle: Self::ParticleType)
Adds a particle to the system
Source§fn add_emitter(&mut self, emitter: Self::EmitterType)
fn add_emitter(&mut self, emitter: Self::EmitterType)
Adds an emitter to the system
Source§fn clean_particles(&mut self)
fn clean_particles(&mut self)
Removes dead particles from the system
Source§fn clean_emitters(&mut self)
fn clean_emitters(&mut self)
Removes dead emitters from the system
Source§fn update_particles(&mut self, dt: f64)
fn update_particles(&mut self, dt: f64)
Iterates over all currently alive particles in the system and calls their update method
Source§fn update_emitters(&mut self, dt: f64) -> Vec<Self::ParticleType>
fn update_emitters(&mut self, dt: f64) -> Vec<Self::ParticleType>
Iterates over all currently alive particle emitters in the system and calls their update method, returning the vector of new particles to add to the system
Auto Trait Implementations§
impl<P, E> Freeze for VecParticleSystem<P, E>
impl<P, E> RefUnwindSafe for VecParticleSystem<P, E>where
P: RefUnwindSafe,
E: RefUnwindSafe,
impl<P, E> Send for VecParticleSystem<P, E>
impl<P, E> Sync for VecParticleSystem<P, E>
impl<P, E> Unpin for VecParticleSystem<P, E>
impl<P, E> UnwindSafe for VecParticleSystem<P, E>where
P: UnwindSafe,
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more