pub struct ParticleSystem { /* private fields */ }Expand description
Zero-allocation fixed-capacity 2D particle simulation engine using active-prefix SoA hot kinematics.
Implementations§
Source§impl ParticleSystem
Particle emission, deterministic PRNG, and active-prefix SoA kinematics for ParticleSystem.
impl ParticleSystem
Particle emission, deterministic PRNG, and active-prefix SoA kinematics for ParticleSystem.
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Sourcepub fn emit_burst(
&mut self,
origin: Point,
count: usize,
config: ParticleEmitterConfig,
)
pub fn emit_burst( &mut self, origin: Point, count: usize, config: ParticleEmitterConfig, )
Emits count particles at origin using config into the compacted active prefix without heap allocations.
§Arguments
&Self- Mutable particle system.Point- World-space emission origin.usize- Number of particles to emit.ParticleEmitterConfig- Emission parameters.
Sourcepub fn active_particle(&self, index: usize) -> Option<Particle>
pub fn active_particle(&self, index: usize) -> Option<Particle>
Source§impl ParticleSystem
impl ParticleSystem
pub fn get_capacity(&self) -> usize
pub fn get_mut_cursor(&mut self) -> &mut usize
pub fn get_mut_rng_state(&mut self) -> &mut u64
pub fn get_gravity(&self) -> Point
pub fn get_mut_gravity(&mut self) -> &mut Point
pub fn set_gravity(&mut self, val: Point) -> &mut Self
pub fn get_active_count(&self) -> usize
pub fn get_mut_active_count(&mut self) -> &mut usize
pub fn set_active_count(&mut self, val: usize) -> &mut Self
Trait Implementations§
Source§impl Clone for ParticleSystem
impl Clone for ParticleSystem
Source§impl Debug for ParticleSystem
impl Debug for ParticleSystem
Auto Trait Implementations§
impl Forget for ParticleSystem
impl Freeze for ParticleSystem
impl Move for ParticleSystem
impl RefUnwindSafe for ParticleSystem
impl Send for ParticleSystemwhere
RawVecInner: Send,
impl Sync for ParticleSystemwhere
RawVecInner: Sync,
impl Unpin for ParticleSystem
impl UnsafeUnpin for ParticleSystemwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<f32>: UnsafeUnpin,
PhantomData<Color>: UnsafeUnpin,
impl UnwindSafe for ParticleSystemwhere
RawVecInner: 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