pub struct ParticleSystem {
pub effect: ParticleEffect,
pub origin: [f32; 3],
pub axis: [f32; 3],
/* private fields */
}Expand description
A single particle system instance with its own buffers and emitter state.
Uses a shared ParticlePipeline for GPU dispatch.
Fields§
§effect: ParticleEffect§origin: [f32; 3]Emitter position in world space.
axis: [f32; 3]Emitter facing axis (unit vector). Newly emitted particles spray in a cone around this axis. Already-emitted particles are unaffected. Default is [0, 1, 0] (upward).
Implementations§
Source§impl ParticleSystem
impl ParticleSystem
pub fn destroy(&mut self, context: &Context)
Sourcepub fn burst(&mut self, count: u32, position: [f32; 3])
pub fn burst(&mut self, count: u32, position: [f32; 3])
Queue a burst of particles at a world position.
Sourcepub fn update(
&mut self,
pipeline: &ParticlePipeline,
encoder: &mut CommandEncoder,
dt: f32,
)
pub fn update( &mut self, pipeline: &ParticlePipeline, encoder: &mut CommandEncoder, dt: f32, )
Update particle simulation and emit new particles.
Sourcepub fn draw(
&self,
pipeline: &ParticlePipeline,
pass: &mut RenderCommandEncoder<'_>,
camera: &CameraParams,
)
pub fn draw( &self, pipeline: &ParticlePipeline, pass: &mut RenderCommandEncoder<'_>, camera: &CameraParams, )
Draw particles with 3D camera projection.
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