pub struct ParticleEmitter {Show 27 fields
pub rate: f32,
pub burst: i32,
pub lifetime: f32,
pub lifetime_variation: f32,
pub speed: f32,
pub speed_variation: f32,
pub spread: f32,
pub gravity: f32,
pub drag: f32,
pub size_start: f32,
pub size_end: f32,
pub color_start: [f32; 4],
pub color_end: [f32; 4],
pub glow: f32,
pub shape: EmitterShape,
pub shape_size: f32,
pub texture: String,
pub looping: bool,
pub duration: f32,
pub max_particles: i32,
pub seed: i32,
pub stretch: f32,
pub collide_floor: bool,
pub floor_height: f32,
pub splash: i32,
pub follow_camera: bool,
pub soft: f32,
/* private fields */
}Expand description
A particle emitter.
Fields§
§rate: f32Particles per second.
burst: i32Particles released at once when the emitter starts.
lifetime: f32Seconds a particle lives.
lifetime_variation: f32Random +/- on the lifetime, 0..1.
speed: f32Initial speed in metres per second.
speed_variation: f32Random +/- on the speed, 0..1.
spread: f32Spread of the launch direction around “up” (the emitter’s local Y), in degrees.
gravity: f32Acceleration in m/s^2 (negative Y falls, positive Y rises like smoke).
drag: f32Air resistance: velocity lost per second, 0..1+.
size_start: f32Size of a particle at birth, metres.
size_end: f32Size at the end of its life.
color_start: [f32; 4]Colour at birth (RGBA).
color_end: [f32; 4]Colour at the end of life (RGBA).
glow: f32Brightness multiplier (glow), values above 1 make them shine.
shape: EmitterShapeWhere particles are born.
shape_size: f32Size of the emission area (radius of a sphere / disc / cone base, half-extent of a box).
texture: StringParticle image (a soft puff or spark with alpha). Empty = a soft round dot.
looping: boolKeep emitting forever; off = one run of duration seconds.
duration: f32Length of one run when not looping.
max_particles: i32Upper limit of simultaneous particles.
seed: i32Random seed.
stretch: f32Stretches particles along their motion (rain streaks, sparks): extra length per m/s.
collide_floor: boolParticles die when they fall below floor_height (world Y).
floor_height: f32World height of the floor for collide_floor.
splash: i32Little splash particles born where a particle hits the floor.
follow_camera: boolThe emitter keeps itself above the active camera (rain or snow around the player).
soft: f32Soft fade where particles cut into surfaces, in metres (0 = hard edges).
Implementations§
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 Component for ParticleEmitter
impl Component for ParticleEmitter
Source§impl Component for ParticleEmitter
impl Component for ParticleEmitter
Source§impl Default for ParticleEmitter
impl Default for ParticleEmitter
Source§impl<'de> Deserialize<'de> for ParticleEmitterwhere
ParticleEmitter: Default,
impl<'de> Deserialize<'de> for ParticleEmitterwhere
ParticleEmitter: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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
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>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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 moreimpl<T> MaybeSync for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.