pub trait ParticleModifier: Send + Sync {
// Required method
fn apply(
&self,
particle: &mut Particle,
step_seconds: f32,
time: Time,
random: &mut Random,
) -> Result<(), ValidationError>;
// Provided methods
fn resets_color(&self) -> bool { ... }
fn work(&self) -> u64 { ... }
fn apply_event(
&self,
particle: &mut Particle,
step_seconds: f32,
time: Time,
random: &mut Random,
) -> Result<bool, ValidationError> { ... }
}Expand description
Ordered per-particle simulation operator, followed by velocity integration.
Required Methods§
Provided Methods§
Sourcefn resets_color(&self) -> bool
fn resets_color(&self) -> bool
Requests birth-color restoration before the ordered modifier chain. Multiplicative lifetime energy curves use this to avoid frame-count accumulation.
Sourcefn apply_event(
&self,
particle: &mut Particle,
step_seconds: f32,
time: Time,
random: &mut Random,
) -> Result<bool, ValidationError>
fn apply_event( &self, particle: &mut Particle, step_seconds: f32, time: Time, random: &mut Random, ) -> Result<bool, ValidationError>
Optional predicted-step collision response, preserving the original callback API.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".