pub struct InstanceSlot { /* private fields */ }Expand description
High-level instance-child slot: tracks the per-slot transition state.
step() resolves
labels against the child runtime context, configures the child’s
playback (animation section, loop, direction), and advances the child’s
frame — leaving only the C++/host-side play() event sink and the
redraw call to the caller.
Implementations§
Source§impl InstanceSlot
impl InstanceSlot
pub const fn new() -> Self
Sourcepub fn is_independent(&self) -> bool
pub fn is_independent(&self) -> bool
Whether the slot is currently driving its child independently of the
parent’s frame. Reflects the most recently seen EventInstance.independent.
Sourcepub fn get_speed(&self) -> f32
pub fn get_speed(&self) -> f32
The speed the most recent Self::step drove the child at, 1.0
before the first. Usually the key’s speed, but while the slot ignores
the implicit frame-0 key it keeps the last real key’s, so the event the
host resolved says 1.0 when the child is not running at it.
Scale the elapsed time handed to the child’s own instance and effect
slots by its absolute value: the child’s sub-tree runs on the child’s
clock. Scaling by the resolved event’s speed instead runs the
grandchildren at the wrong rate every time the parent goes back before
the first real key of an independent child.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset the slot’s “last started key” memory to its just-created state so
the host can re-fire the instance child on an explicit head-out (play
/ replay) instead of debouncing the first key as the same one it last
started. The child context is owned by the host and reset
separately; the next step re-configures it on transition, and the host
plays it.
Sourcepub fn step(
&mut self,
ev: ss_event_instance_info,
child_ctx: &mut Context<'_>,
parent_frame: f32,
delta_seconds: f32,
parent_looped: bool,
) -> ss_instance_step_result
pub fn step( &mut self, ev: ss_event_instance_info, child_ctx: &mut Context<'_>, parent_frame: f32, delta_seconds: f32, parent_looped: bool, ) -> ss_instance_step_result
Drive the slot for one tick. Configures child_ctx on transition
edges and advances its frame either by parent-relative seek or by
delta-time update depending on independent.