VecParticleSystem

Struct VecParticleSystem 

Source
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>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<P: Debug, E: Debug> Debug for VecParticleSystem<P, E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P, E> Default for VecParticleSystem<P, E>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<P: Particle, E: ParticleEmitter<ParticleType = P>> ParticleSystem for VecParticleSystem<P, E>

Source§

type ParticleType = P

This system can hold any particle that implements Particle with the same Coordinate type

Source§

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>

Returns an iterator over all currently alive particles in the system
Source§

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>

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>

Returns a mutable iterator over all currently alive particle emitters in the system
Source§

fn add_particle(&mut self, particle: Self::ParticleType)

Adds a particle to the system
Source§

fn add_emitter(&mut self, emitter: Self::EmitterType)

Adds an emitter to the system
Source§

fn clean_particles(&mut self)

Removes dead particles from the system
Source§

fn clean_emitters(&mut self)

Removes dead emitters from the system
Source§

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>

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
Source§

fn update(&mut self, dt: f64)

Updates the particle system Read more

Auto Trait Implementations§

§

impl<P, E> Freeze for VecParticleSystem<P, E>

§

impl<P, E> RefUnwindSafe for VecParticleSystem<P, E>

§

impl<P, E> Send for VecParticleSystem<P, E>
where P: Send, E: Send,

§

impl<P, E> Sync for VecParticleSystem<P, E>
where P: Sync, E: Sync,

§

impl<P, E> Unpin for VecParticleSystem<P, E>
where P: Unpin, E: Unpin,

§

impl<P, E> UnwindSafe for VecParticleSystem<P, E>
where P: UnwindSafe, E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.