Skip to main content

ParticleSimulationBuilder

Struct ParticleSimulationBuilder 

Source
pub struct ParticleSimulationBuilder { /* private fields */ }
Expand description

Collects a particle simulation’s settings; build validates them.

Implementations§

Source§

impl ParticleSimulationBuilder

Source

pub fn style(self, style: ParticleStyle) -> Self

Sets presentation; it does not affect the physics snapshots.

Source§

impl ParticleSimulationBuilder

Source

pub fn new(seed: u64) -> Self

Starts a simulation with an explicit deterministic seed.

Source

pub fn duration(self, duration: Duration) -> Self

Sets finite preparation duration; otherwise render inherits clip duration.

Source

pub fn step(self, step: Duration) -> Self

Sets an exact positive integer-tick step; no variable last integration step.

Source

pub fn snapshot_interval(self, steps: u64) -> Self

Requests snapshot spacing; memory admission may increase it automatically.

Source

pub fn limits(self, limits: SimulationLimits) -> Self

Replaces logical resource allowances.

Source

pub fn emitter(self, emitter: impl ParticleEmitter + 'static) -> Self

Appends one fixed-boundary emitter, in declaration order.

Source

pub fn modifier(self, modifier: impl ParticleModifier + 'static) -> Self

Appends one deterministic operator; ordering is significant.

Source

pub fn group_modifier( self, modifier: impl ParticleGroupModifier + 'static, ) -> Self

Adds a population operator before independent particle updates.

Source

pub fn sub_emitter(self, emitter: SubEmitter) -> Self

Adds a stable-order, bounded event emitter rule.

Source

pub fn prewarm(self, duration: Duration) -> Self

Prepares a steady-state lead-in without changing the visible clip duration.

Source

pub fn loop_period(self, period: Duration) -> Self

Enables deterministic dual-phase seamless looping; two live populations share the limit.

Source

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.

Source

pub fn workers(self, workers: usize) -> Self

Requests 1..=64 CPU workers; independent updates retain stable IDs and event order.

Source

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.

Trait Implementations§

Source§

impl Clone for ParticleSimulationBuilder

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.