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) -> GraphCursor
pub fn start(graph: &CompiledGraph) -> GraphCursor
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 moreAuto Trait Implementations§
impl Freeze for GraphCursor
impl RefUnwindSafe for GraphCursor
impl Send for GraphCursor
impl Sync for GraphCursor
impl Unpin for GraphCursor
impl UnsafeUnpin for GraphCursor
impl UnwindSafe for GraphCursor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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