pub struct GraphCursor {
pub state: usize,
pub clock: f32,
pub fade: Option<StateFade>,
}Expand description
The live position in a graph: current state, its clock, and any in-flight crossfade. One per graph target, owned by the client’s AnimationSystem.
Clock units depend on the state’s play: seconds (scaled by rate) for
single clips and non-sync blendspaces, normalized phase (one full pass of
the blend = 1.0) for phase-synced blendspaces, where member clips of
different lengths must share one wrap point.
Fields§
§state: usizeThe state the cursor is in.
clock: f32The state’s clock, in the units its play uses.
fade: Option<StateFade>The in-flight crossfade, when one is running.
Implementations§
Source§impl GraphCursor
impl GraphCursor
Sourcepub fn start(graph: &CompiledGraph) -> Self
pub fn start(graph: &CompiledGraph) -> Self
A cursor parked at the graph’s initial state.
Sourcepub fn advance(&mut self, graph: &CompiledGraph, params: &[f32], dt_secs: f32)
pub fn advance(&mut self, graph: &CompiledGraph, params: &[f32], dt_secs: f32)
Advance clocks by dt_secs and take at most one transition. Transition
checks run against the current state’s outgoing list in declaration
order; the first whose exit-time gate and conditions all pass wins.
Taking a transition while a fade is in flight replaces the fade: the
new fade blends from the interrupted fade’s incoming state only, so a
rapid double transition can pop the older outgoing pose.
Trait Implementations§
Source§impl Clone for GraphCursor
impl Clone for GraphCursor
Source§fn clone(&self) -> GraphCursor
fn clone(&self) -> GraphCursor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more