pub struct ParticleSimulation { /* private fields */ }Expand description
Lazy fixed-step replay, created by ParticleSimulationBuilder::build. The first clip
duration fixes a shared preparation; reusing one cache instance with a different
duration is rejected explicitly. The configuration never changes after building.
Implementations§
Source§impl ParticleSimulation
impl ParticleSimulation
Sourcepub fn try_render(
&self,
context: &SceneContext<'_>,
) -> Result<Node, ValidationError>
pub fn try_render( &self, context: &SceneContext<'_>, ) -> Result<Node, ValidationError>
Renders through the instance protocol using explicit clip metadata.
Source§impl ParticleSimulation
impl ParticleSimulation
Sourcepub fn new(seed: u64) -> ParticleSimulationBuilder
pub fn new(seed: u64) -> ParticleSimulationBuilder
Starts a lazy fixed-step simulation with an explicit deterministic seed. Cache the
built value with SceneContext::try_cache rather than building one afresh for every frame.
Source§impl ParticleSimulation
impl ParticleSimulation
Sourcepub fn to_builder(&self) -> ParticleSimulationBuilder
pub fn to_builder(&self) -> ParticleSimulationBuilder
Reopens the settings for editing; the new simulation prepares afresh.
Sourcepub fn sample(&self, time: Time) -> Result<Arc<[Particle]>, ValidationError>
pub fn sample(&self, time: Time) -> Result<Arc<[Particle]>, ValidationError>
Queries at the containing fixed boundary, never integrating a variable remainder. Outside [0,duration) is empty. Source initialization is shared.
Sourcepub fn sample_in(
&self,
time: Time,
clip_duration: Option<Duration>,
) -> Result<Arc<[Particle]>, ValidationError>
pub fn sample_in( &self, time: Time, clip_duration: Option<Duration>, ) -> Result<Arc<[Particle]>, ValidationError>
Queries using explicit finite clip metadata when no duration was configured.
Sourcepub fn stats(&self) -> Result<SimulationStats, ValidationError>
pub fn stats(&self) -> Result<SimulationStats, ValidationError>
Returns preparation stats without evaluating a rendered frame.
Sourcepub fn events(&self, time: Time) -> Result<Vec<ParticleEvent>, ValidationError>
pub fn events(&self, time: Time) -> Result<Vec<ParticleEvent>, ValidationError>
Returns events at the containing fixed boundary, sorted by stable ID and trigger kind.