pub struct DebrisSpawner { /* private fields */ }Expand description
Spawns debris particles into a DebrisPool from entity death events.
Implementations§
Source§impl DebrisSpawner
impl DebrisSpawner
pub fn new(seed: u64) -> Self
Sourcepub fn spawn(
&mut self,
event: &EntityDeathEvent,
pool: &mut DebrisPool,
) -> usize
pub fn spawn( &mut self, event: &EntityDeathEvent, pool: &mut DebrisPool, ) -> usize
Spawn debris for an entity death, returning the number of particles actually spawned (limited by pool capacity).
Sourcepub fn spawn_radial_burst(
&mut self,
center: Vec3,
glyphs: &[char],
colors: &[[f32; 4]],
debris_type: DebrisType,
count: usize,
pool: &mut DebrisPool,
) -> usize
pub fn spawn_radial_burst( &mut self, center: Vec3, glyphs: &[char], colors: &[[f32; 4]], debris_type: DebrisType, count: usize, pool: &mut DebrisPool, ) -> usize
Spawn a radial burst — particles fly outward uniformly in a ring.
Sourcepub fn spawn_directional(
&mut self,
center: Vec3,
direction: Vec3,
glyphs: &[char],
colors: &[[f32; 4]],
debris_type: DebrisType,
count: usize,
cone_half_angle: f32,
pool: &mut DebrisPool,
) -> usize
pub fn spawn_directional( &mut self, center: Vec3, direction: Vec3, glyphs: &[char], colors: &[[f32; 4]], debris_type: DebrisType, count: usize, cone_half_angle: f32, pool: &mut DebrisPool, ) -> usize
Spawn directional debris — particles fly in a cone along direction.
Sourcepub fn spawn_shatter(
&mut self,
center: Vec3,
glyphs: &[char],
colors: &[[f32; 4]],
debris_type: DebrisType,
pool: &mut DebrisPool,
) -> usize
pub fn spawn_shatter( &mut self, center: Vec3, glyphs: &[char], colors: &[[f32; 4]], debris_type: DebrisType, pool: &mut DebrisPool, ) -> usize
Spawn shatter debris — each glyph is split into 2-3 sub-pieces that fall with high restitution. Typically used for Ice death.
Auto Trait Implementations§
impl Freeze for DebrisSpawner
impl RefUnwindSafe for DebrisSpawner
impl Send for DebrisSpawner
impl Sync for DebrisSpawner
impl Unpin for DebrisSpawner
impl UnsafeUnpin for DebrisSpawner
impl UnwindSafe for DebrisSpawner
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.