pub struct ParticleSystem {
pub buffer: ParticleBuffer,
pub emitters: Vec<ParticleEmitter>,
pub gravity: GravityForce,
pub drag: DragForce,
pub floor: Option<FloorCollision>,
pub rng: SimpleRng,
pub time: f32,
}Expand description
High-level particle system that owns a buffer, emitters, and forces.
Fields§
§buffer: ParticleBufferThe SoA particle data.
emitters: Vec<ParticleEmitter>All registered emitters.
gravity: GravityForceGlobal gravity.
drag: DragForceGlobal drag.
floor: Option<FloorCollision>Optional floor collision plane.
rng: SimpleRngInternal RNG for emitter seeding.
time: f32Elapsed simulation time.
Implementations§
Source§impl ParticleSystem
impl ParticleSystem
Sourcepub fn new(capacity: usize) -> Self
pub fn new(capacity: usize) -> Self
Create a new particle system with the given buffer capacity.
Sourcepub fn add_emitter(&mut self, emitter: ParticleEmitter) -> usize
pub fn add_emitter(&mut self, emitter: ParticleEmitter) -> usize
Register an emitter and return its index.
Auto Trait Implementations§
impl Freeze for ParticleSystem
impl RefUnwindSafe for ParticleSystem
impl Send for ParticleSystem
impl Sync for ParticleSystem
impl Unpin for ParticleSystem
impl UnsafeUnpin for ParticleSystem
impl UnwindSafe for ParticleSystem
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more