Skip to main content

ParticleModifier

Trait ParticleModifier 

Source
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§

Source

fn apply( &self, particle: &mut Particle, step_seconds: f32, time: Time, random: &mut Random, ) -> Result<(), ValidationError>

Updates one live particle; index and canonical age remain engine-owned.

Provided Methods§

Source

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.

Source

fn work(&self) -> u64

Conservative per-particle operator work charged before replay.

Source

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".

Implementors§