Struct bevy_particle_systems::components::Particle
source · pub struct Particle {
pub parent_system: Entity,
pub max_lifetime: f32,
pub max_distance: Option<f32>,
pub use_scaled_time: bool,
pub initial_scale: f32,
pub scale: ValueOverTime,
pub velocity_modifiers: Vec<VelocityModifier>,
pub rotation_speed: f32,
pub despawn_with_parent: bool,
}
Expand description
An individual Particle, spawned by a ParticleSystem
The parent_entity
should link to the entity with the spawning ParticleSystem
on it.
If the parent_entity
no longer exists or does not contain a ParticleSystem
the particle will
be despawned immediately.
The parent should be linked here explicitly because particles may operate in world space, and not be actual
children of the ParticleSystem
itself.
Fields§
§parent_system: Entity
The entity on which the spawning ParticleSystem
resides.
max_lifetime: f32
The total lifetime of the particle.
When the Lifetime
component value reaches this value, the particle is considered dead and will be despawned.
max_distance: Option<f32>
The maximum distance traveled for the particle.
When the DistanceTraveled
component value reaches this value, the particle is considered dead and will be despawned.
use_scaled_time: bool
Whether the particle will respect scaled time in its transformations.
This is copied from ParticleSystem::use_scaled_time
on spawn.
initial_scale: f32
The initial scale of the particle, multiplied with scale
to produce
the final scale of the particle.
scale: ValueOverTime
The scale or size of this particle over time.
This is copied from ParticleSystem::scale
on spawn.
velocity_modifiers: Vec<VelocityModifier>
Velocity Modifiers of this particle.
This is copied from ParticleSystem::velocity_modifiers
on spawn.
rotation_speed: f32
The speed, in radian per second, at which the particle rotates.
This is chosen from ParticleSystem::rotation_speed
on spawn.
despawn_with_parent: bool
Indicates whether the particle should be cleaned up when the parent system is despawned
Trait Implementations§
source§impl Component for Particle
impl Component for Particle
§type Storage = TableStorage
type Storage = TableStorage
TableStorage
or SparseStorage
.Auto Trait Implementations§
impl RefUnwindSafe for Particle
impl Send for Particle
impl Sync for Particle
impl Unpin for Particle
impl UnwindSafe for Particle
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
[ShaderType
] for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut Components, storages: &mut Storages, ids: &mut impl FnMut(ComponentId) )
unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> C
§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>
. Box<dyn Any>
can
then be further downcast
into Box<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>
. Rc<Any>
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> DowncastSync for T
impl<T> DowncastSync for T
source§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
fn get_components(self, func: &mut impl FnMut(StorageType, OwningPtr<'_>))
source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World
.