pub struct ParticleSimulationBuilder { /* private fields */ }Expand description
Collects a particle simulation’s settings; build validates them.
Implementations§
Source§impl ParticleSimulationBuilder
impl ParticleSimulationBuilder
Sourcepub fn style(self, style: ParticleStyle) -> Self
pub fn style(self, style: ParticleStyle) -> Self
Sets presentation; it does not affect the physics snapshots.
Source§impl ParticleSimulationBuilder
impl ParticleSimulationBuilder
Sourcepub fn duration(self, duration: Duration) -> Self
pub fn duration(self, duration: Duration) -> Self
Sets finite preparation duration; otherwise render inherits clip duration.
Sourcepub fn step(self, step: Duration) -> Self
pub fn step(self, step: Duration) -> Self
Sets an exact positive integer-tick step; no variable last integration step.
Sourcepub fn snapshot_interval(self, steps: u64) -> Self
pub fn snapshot_interval(self, steps: u64) -> Self
Requests snapshot spacing; memory admission may increase it automatically.
Sourcepub fn limits(self, limits: SimulationLimits) -> Self
pub fn limits(self, limits: SimulationLimits) -> Self
Replaces logical resource allowances.
Sourcepub fn emitter(self, emitter: impl ParticleEmitter + 'static) -> Self
pub fn emitter(self, emitter: impl ParticleEmitter + 'static) -> Self
Appends one fixed-boundary emitter, in declaration order.
Sourcepub fn modifier(self, modifier: impl ParticleModifier + 'static) -> Self
pub fn modifier(self, modifier: impl ParticleModifier + 'static) -> Self
Appends one deterministic operator; ordering is significant.
Sourcepub fn group_modifier(
self,
modifier: impl ParticleGroupModifier + 'static,
) -> Self
pub fn group_modifier( self, modifier: impl ParticleGroupModifier + 'static, ) -> Self
Adds a population operator before independent particle updates.
Sourcepub fn sub_emitter(self, emitter: SubEmitter) -> Self
pub fn sub_emitter(self, emitter: SubEmitter) -> Self
Adds a stable-order, bounded event emitter rule.
Sourcepub fn prewarm(self, duration: Duration) -> Self
pub fn prewarm(self, duration: Duration) -> Self
Prepares a steady-state lead-in without changing the visible clip duration.
Sourcepub fn loop_period(self, period: Duration) -> Self
pub fn loop_period(self, period: Duration) -> Self
Enables deterministic dual-phase seamless looping; two live populations share the limit.
Sourcepub fn time_remap(
self,
scale: f64,
offset: Duration,
allow_reverse: bool,
) -> Self
pub fn time_remap( self, scale: f64, offset: Duration, allow_reverse: bool, ) -> Self
Remaps query time. Negative scales require allow_reverse, which explicitly revives past particles.
Sourcepub fn workers(self, workers: usize) -> Self
pub fn workers(self, workers: usize) -> Self
Requests 1..=64 CPU workers; independent updates retain stable IDs and event order.
Sourcepub fn build(self) -> Result<ParticleSimulation, ValidationError>
pub fn build(self) -> Result<ParticleSimulation, ValidationError>
Checks everything that does not depend on the clip duration and freezes the simulation. Duration-dependent limits are checked when it is first sampled.