pub struct GpuParticleEmitter {
pub position: [f32; 3],
pub shape: EmitterShape,
pub mode: EmissionMode,
pub initial_velocity: [f32; 3],
pub lifetime: f32,
pub mass: f32,
pub active: bool,
pub accumulator: f32,
/* private fields */
}Expand description
GPU particle emitter with configurable shape and mode.
Fields§
§position: [f32; 3]World-space spawn origin.
shape: EmitterShapeEmitter shape.
mode: EmissionModeEmission mode.
initial_velocity: [f32; 3]Base initial velocity.
lifetime: f32Particle lifetime (seconds).
mass: f32Particle mass.
active: boolWhether emitter is active.
accumulator: f32Fractional accumulator for continuous mode.
Implementations§
Source§impl GpuParticleEmitter
impl GpuParticleEmitter
Sourcepub fn new_continuous(position: [f32; 3], rate: f32, lifetime: f32) -> Self
pub fn new_continuous(position: [f32; 3], rate: f32, lifetime: f32) -> Self
Create a new emitter with a point shape and continuous mode.
Sourcepub fn new_burst(position: [f32; 3], count: usize, lifetime: f32) -> Self
pub fn new_burst(position: [f32; 3], count: usize, lifetime: f32) -> Self
Create a burst emitter.
Sourcepub fn emit(&mut self, buffer: &mut ParticleBuffer, dt: f32) -> usize
pub fn emit(&mut self, buffer: &mut ParticleBuffer, dt: f32) -> usize
Emit particles into a buffer for one timestep dt.
Sourcepub fn burst_count(&self) -> usize
pub fn burst_count(&self) -> usize
Number of particles this emitter will emit in one burst (or 0 if continuous).
Auto Trait Implementations§
impl Freeze for GpuParticleEmitter
impl RefUnwindSafe for GpuParticleEmitter
impl Send for GpuParticleEmitter
impl Sync for GpuParticleEmitter
impl Unpin for GpuParticleEmitter
impl UnsafeUnpin for GpuParticleEmitter
impl UnwindSafe for GpuParticleEmitter
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