Skip to main content

mirage_engine/animation/
mod.rs

1//! The machine a game poses a draw with: the states it moves between, what
2//! each of them plays, and how far along that is.
3//!
4//! A game writes its states as a fieldless enum under [`AnimationStates`],
5//! which states what each state plays — a clip looping, a clip once, two
6//! blended, or one a value scrubs — and where the machine goes from there.
7//! [`ctx.animate`](crate::TickContext::animate) runs an [`Animator`] of
8//! those states against the game's own input, and
9//! [`Instance::posed`](crate::mesh::Instance::posed) draws a mesh in the
10//! pose it holds. No clip length and no time of a game's own crosses either
11//! call: a state reads [`Progress`] and states a [`Transition`].
12
13pub use animator::Animator;
14pub use motion::Motion;
15pub(crate) use motion::Timed;
16pub(crate) use posed::Running;
17pub use progress::Progress;
18pub use states::{AnimationStates, Transition};
19
20mod animator;
21mod motion;
22mod posed;
23mod progress;
24mod states;