pub struct Plume { /* private fields */ }Implementations§
Source§impl Plume
impl Plume
pub fn with_capacity(capacity: usize) -> Self
Sourcepub fn launch(
&mut self,
rng: &mut impl Rng,
src: u8,
v0: f32,
zenith: (f32, f32),
) -> bool
pub fn launch( &mut self, rng: &mut impl Rng, src: u8, v0: f32, zenith: (f32, f32), ) -> bool
Launch one grain from src at speed v0, zenith angle uniform in solid angle over
[zenith.0, zenith.1] (radians) and azimuth uniform. Returns false when the
pool is full.
Sourcepub fn launch_rays(
&mut self,
rng: &mut impl Rng,
src: u8,
v0: f32,
zenith: (f32, f32),
rays: u32,
) -> bool
pub fn launch_rays( &mut self, rng: &mut impl Rng, src: u8, v0: f32, zenith: (f32, f32), rays: u32, ) -> bool
launch, but with the azimuth drawn from rays evenly spaced
directions (a little jittered), so the plume shows radial filaments; rays = 0
is a uniform azimuth.
Sourcepub fn step(&mut self, dt: f32, g: f32, landed: impl FnMut(&Grain))
pub fn step(&mut self, dt: f32, g: f32, landed: impl FnMut(&Grain))
Fly every grain for dt seconds under gravity g (down z); a grain that
reaches the ground (z ≤ 0 after lift-off) is reported to landed at its exact
landing point and removed.
pub fn iter(&self) -> impl Iterator<Item = &Grain>
pub fn clear(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Forget for Plume
impl Freeze for Plume
impl Move for Plume
impl RefUnwindSafe for Plume
impl Send for Plume
impl Sync for Plume
impl Unpin for Plume
impl UnsafeUnpin for Plume
impl UnwindSafe for Plume
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