Skip to main content

ParticleSimulation

Struct ParticleSimulation 

Source
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

Source

pub fn try_render( &self, context: &SceneContext<'_>, ) -> Result<Node, ValidationError>

Renders through the instance protocol using explicit clip metadata.

Source§

impl ParticleSimulation

Source

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

Source

pub fn to_builder(&self) -> ParticleSimulationBuilder

Reopens the settings for editing; the new simulation prepares afresh.

Source

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.

Source

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.

Source

pub fn stats(&self) -> Result<SimulationStats, ValidationError>

Returns preparation stats without evaluating a rendered frame.

Source

pub fn events(&self, time: Time) -> Result<Vec<ParticleEvent>, ValidationError>

Returns events at the containing fixed boundary, sorted by stable ID and trigger kind.

Trait Implementations§

Source§

impl Clone for ParticleSimulation

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

impl Scene for ParticleSimulation

Source§

fn render(&self, context: &SceneContext<'_>) -> Node

Builds one snapshot without retaining previous-frame state.
Source§

fn duration(&self) -> Option<Duration>

Natural finite duration, or None when a caller must provide one.
Source§

fn validate(&self) -> Result<(), Error>

Validates deferred authoring errors without evaluating a frame.
Source§

fn with_duration(self, duration: Duration) -> WithDuration<Self>
where Self: Sized,

Overrides clip metadata without retiming or clamping the callback. 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.