pub struct ParticleEmitter {Show 29 fields
pub emitter_type: EmitterType,
pub shape: EmitterShape,
pub position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
pub direction: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
pub spawn_rate: f32,
pub burst_count: u32,
pub particle_lifetime_min: f32,
pub particle_lifetime_max: f32,
pub initial_velocity_min: f32,
pub initial_velocity_max: f32,
pub velocity_spread: f32,
pub gravity: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
pub drag: f32,
pub size_start: f32,
pub size_end: f32,
pub color_gradient: ColorGradient,
pub emissive_strength: f32,
pub enabled: bool,
pub accumulated_spawn: f32,
pub one_shot: bool,
pub has_fired: bool,
pub turbulence_strength: f32,
pub turbulence_frequency: f32,
pub texture_index: u32,
pub size_curve: Vec<(f32, f32)>,
pub opacity_curve: Vec<(f32, f32)>,
pub death_sub_emitter: Option<String>,
pub trail_sub_emitter: Option<String>,
pub trail_spawn_interval: f32,
}Expand description
Particle emitter component.
Spawns particles continuously at spawn_rate or in bursts of burst_count.
Each particle is simulated independently with its own velocity, gravity, and lifetime.
Fields§
§emitter_type: EmitterTypeEffect type for shader selection and behavior hints.
shape: EmitterShapeVolume from which particles are emitted.
position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>Emitter position in local space (added to entity transform).
direction: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>Primary emission direction (for directional shapes).
spawn_rate: f32Particles spawned per second (0 for burst-only).
burst_count: u32Number of particles to spawn immediately when enabled.
particle_lifetime_min: f32Minimum particle lifetime in seconds.
particle_lifetime_max: f32Maximum particle lifetime in seconds.
initial_velocity_min: f32Minimum initial speed along emission direction.
initial_velocity_max: f32Maximum initial speed along emission direction.
velocity_spread: f32Random angular spread from direction (radians).
gravity: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>Acceleration applied each frame (typically downward for gravity).
drag: f32Velocity damping factor (0 = no damping, 1 = full stop immediately).
size_start: f32Particle size at birth.
size_end: f32Particle size at death.
color_gradient: ColorGradientColor and alpha over particle lifetime.
emissive_strength: f32Emission multiplier for HDR bloom.
enabled: boolWhether the emitter is active.
accumulated_spawn: f32Internal accumulator for fractional particle spawning.
one_shot: boolIf true, fires burst once then disables.
has_fired: boolWhether the one-shot burst has already fired.
turbulence_strength: f32Strength of noise-based position perturbation.
turbulence_frequency: f32Frequency of turbulence noise sampling.
texture_index: u32Texture array layer index (0 = procedural shape, 1+ = texture from array).
size_curve: Vec<(f32, f32)>Keyframed size over particle lifetime. When non-empty,
overrides the linear size_start to size_end interpolation.
Each entry is (normalized_time, size).
opacity_curve: Vec<(f32, f32)>Keyframed opacity over particle lifetime. When non-empty, multiplies the gradient alpha by the sampled value. Each entry is (normalized_time, opacity).
death_sub_emitter: Option<String>Sub-emitter spawn behavior on particle death. The named entry references a prefab path in the prefab cache. Empty = no sub-emitter.
trail_sub_emitter: Option<String>Spawn a sub-emitter every trail_spawn_interval seconds along
the particle’s path. 0 disables trails.
trail_spawn_interval: f32Implementations§
Source§impl ParticleEmitter
impl ParticleEmitter
Sourcepub fn firework_shell(
position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
velocity: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
) -> ParticleEmitter
pub fn firework_shell( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, velocity: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, ) -> ParticleEmitter
Creates a rising firework shell with trailing sparks.
Sourcepub fn firework_explosion(
position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
color: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
particle_count: u32,
) -> ParticleEmitter
pub fn firework_explosion( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, color: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, particle_count: u32, ) -> ParticleEmitter
Creates a spherical firework burst.
pub fn firework_willow( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, color: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, particle_count: u32, ) -> ParticleEmitter
pub fn firework_chrysanthemum( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, color: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, particle_count: u32, ) -> ParticleEmitter
pub fn firework_ring( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, color: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, particle_count: u32, ) -> ParticleEmitter
pub fn firework_glitter( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, particle_count: u32, ) -> ParticleEmitter
pub fn firework_crackle( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, particle_count: u32, ) -> ParticleEmitter
pub fn flash_burst( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, ) -> ParticleEmitter
pub fn comet_shell( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, velocity: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, ) -> ParticleEmitter
pub fn palm_explosion( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, color: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, particle_count: u32, ) -> ParticleEmitter
pub fn crossette_burst( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, color: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, particle_count: u32, ) -> ParticleEmitter
pub fn strobe_effect( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, particle_count: u32, ) -> ParticleEmitter
pub fn trailing_sparks( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, velocity: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, ) -> ParticleEmitter
Sourcepub fn fire(
position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
) -> ParticleEmitter
pub fn fire( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, ) -> ParticleEmitter
Creates a continuous fire effect.
Sourcepub fn smoke(
position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
) -> ParticleEmitter
pub fn smoke( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, ) -> ParticleEmitter
Creates a continuous smoke plume.
Sourcepub fn sparks(
position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>,
) -> ParticleEmitter
pub fn sparks( position: Matrix<f32, Const<3>, Const<1>, ArrayStorage<f32, 3, 1>>, ) -> ParticleEmitter
Creates a continuous spark fountain.
Trait Implementations§
Source§impl Clone for ParticleEmitter
impl Clone for ParticleEmitter
Source§fn clone(&self) -> ParticleEmitter
fn clone(&self) -> ParticleEmitter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParticleEmitter
impl Debug for ParticleEmitter
Source§impl Default for ParticleEmitter
impl Default for ParticleEmitter
Source§fn default() -> ParticleEmitter
fn default() -> ParticleEmitter
Source§impl<'de> Deserialize<'de> for ParticleEmitter
impl<'de> Deserialize<'de> for ParticleEmitter
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ParticleEmitter, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ParticleEmitter, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ParticleEmitter
impl PartialEq for ParticleEmitter
Source§fn eq(&self, other: &ParticleEmitter) -> bool
fn eq(&self, other: &ParticleEmitter) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ParticleEmitter
impl Serialize for ParticleEmitter
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ParticleEmitter
Auto Trait Implementations§
impl Freeze for ParticleEmitter
impl RefUnwindSafe for ParticleEmitter
impl Send for ParticleEmitter
impl Sync for ParticleEmitter
impl Unpin for ParticleEmitter
impl UnsafeUnpin for ParticleEmitter
impl UnwindSafe for ParticleEmitter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.