Skip to main content

AnimNode

Struct AnimNode 

Source
pub struct AnimNode {
    pub(super) content: NodeContent,
    pub(super) internal_time_secs: f64,
    pub(super) rate_func: Option<fn(f64) -> f64>,
    pub(super) time_range: Range<f64>,
    pub(super) enabled: bool,
    pub(super) anim_name: &'static str,
}
Expand description

A single runtime animation node: one closed NodeContent plus everything every kind shares — the subtree, the content axis, and the timing shell (window, rate, enable) in this node’s parent’s coordinates.

Fields§

§content: NodeContent§internal_time_secs: f64

Length of this node’s content time axis, in seconds: the sequence cursor or stack extent for containers, a sound’s play window, 1.0 for bare visual leaves, 0.0 for statics.

§rate_func: Option<fn(f64) -> f64>§time_range: Range<f64>§enabled: bool§anim_name: &'static str

Implementations§

Source§

impl AnimNode

Source

pub(crate) fn children(&self) -> &[AnimNode]

This node’s children — only the container kinds have any; leaves read as the empty slice, so traversals stay uniform without storing an impossible empty Vec per leaf.

Source

pub fn time_range(&self) -> Range<f64> ⓘ

Global or parent-relative time range, depending on its containing plan.

Source

pub fn duration_secs(&self) -> f64

Duration in seconds.

Source

pub(super) fn shift_by(&mut self, offset_sec: f64)

Source

pub fn enabled(&self) -> bool

Whether this clip contributes a value.

Source

pub fn anim_name(&self) -> &str

Concrete evaluator type name captured before erasure.

Source

pub fn active_at(&self, sec: f64) -> bool

Whether the given scene time is inside this clip’s inclusive range.

Source

fn local_alpha(&self, sec: f64) -> f64

Compute the rate-warped progress in this cell’s local coordinates.

The cell owns the time configuration (start, duration, rate function) and turns it into a reading; evaluators never see the configuration itself. A zero-duration cell reports alpha == 1.0.

Source

pub(crate) fn eval_at(&self, sec: f64, output: &mut Vec<DynItem>)

Evaluate this node at a time point — the ONLY time-management entry.

Remaps the scene time to this node’s local alpha (via its rate function), then evaluates the content at that progress (a pure query on &self). Direction management (forward vs backward reset+replay, how many sim_steps to integrate) is INTERNAL to each stateful node. Audio nodes evaluate to nothing here: their content resolves through the seal-time audio bake (bake_audio) instead of the frame pipeline.

Source

pub(crate) fn bake_into<'a>( &'a self, span: (f64, f64), aff: Option<MixAff>, path: &mut Vec<&'a Self>, warp_paths: &mut Vec<Vec<&'a Self>>, pcm: &mut [f32], sample_rate: f64, )

Bake this subtree’s audio into pcm (the whole timeline’s interleaved stereo buffer, absolute frame indices), collecting what cannot be pre-mixed.

The descent composes the affine global→content map (aff) while every rate along the path is linear; a linear sound leaf then knows its exact audible frame range and mixes it in one tight loop (AudioTrack::mix_span_into). A leaf behind any non-linear rate has no such map — its root-to-leaf path is pushed to warp_paths for the residual pass instead. The tree is never mutated.

Source

pub(crate) fn has_audio(&self) -> bool

Whether any sound leaf lives in this subtree (enabled or not).

Source

pub(super) fn contains_sec(&self, sec: f64, parent_duration: f64) -> bool

Source

pub(crate) fn animation_info(&self) -> AnimationInfo

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<T> Discard for T

Source§

fn discard(&self)

Simply returns ()
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoResult<T> for T

§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> TransformedExt for T

Source§

fn transformed<G>(self, transform: G) -> Transformed<Self, G>

Return self wrapped with transform stored exactly as G.
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> With for T

Source§

fn with(self, f: impl Fn(&mut Self)) -> Self
where Self: Sized,

Mutating a value in place
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more