Skip to main content

Crate telar_motion_core

Crate telar_motion_core 

Source
Expand description

The rsx motion engine: signal-backed values that chase a target over time, driven by a central frame ticker. An Animated<T> wraps a reactive signal whose value is interpolated toward target by a Curve (a Tween or a Spring); tick advances every registered animation once per frame. Colors interpolate in Oklch (see Lerp) as a deliberate perceptual choice.

Structs§

Animated
A signal-backed value that chases a target over time under a Curve, driven by the central ticker.
Keyframes
A signal-backed, autonomous multi-step animation: it plays a fixed sequence rather than chasing a live target, driven by the same central ticker as crate::Animated.
KeyframesBuilder
Accumulates steps for a Keyframes sequence before it starts.
Spring
A physical spring parameterized by raw stiffness, damping, and mass.
Tween
A time-based interpolation over a fixed duration shaped by easing.

Enums§

Curve
The motion model backing an crate::Animated value.
Easing
Timing function mapping normalized time t in [0, 1] to eased progress.
Repeat
How a Keyframes sequence behaves once it reaches its last step.

Traits§

Lerp
Interpolation plus the minimal vector-space operations the engine needs.

Functions§

has_active
Whether any animation is still unsettled; the runner uses this to keep scheduling frames. Non-mutating: a Weak can go dead between tick and this call, so it re-tests liveness rather than trusting emptiness.
reset
Drop all registered animations; parallels reactive reset_runtime on tree teardown / hot reload.
set_scale
Set the global time scale (D5). 1.0 is normal; 0.0 makes animations jump instantly to their targets; values in between slow motion down. Negative inputs clamp to 0.0.
spring
Build a Spring from stiffness and damping; mass defaults to 1.0.
tick
Integrate every active animation to now, publishing changed values and deregistering settled ones.
tween
Build a Tween from a duration and easing.