system
Generated Rust API reference for byte_engine.
byte_engine / animation / system
Module system
The animation system an application steps on its world scope: it plays every animator's graph and posts each one's pose and root motion, as the animation reference's Animators section specifies.
Quick Reference
| Item | Kind | Description |
|---|---|---|
Animator | struct | The Animator struct is the request to play one graph on one entity, created through the world under the handle of the entity it poses, usually a skinned renderable. |
AnimationGraphId | struct | The AnimationGraphId struct names a graph an [AnimationSystem] owns, so animators and the application refer to it without holding it. |
RootMotionUpdate | struct | The RootMotionUpdate struct carries the root motion a step extracted for one animator, for the code that owns the entity to move it by. |
AnimationSystem | struct | The AnimationSystem struct plays the animators of a world scope: each step it adopts new ones, applies the latest request and look target sent to each, advances them together, and posts every pose and root motion. |
Structs
Animator
struct Animator {
// [REDACTED: Private Fields]
}Defined in crates/byte-engine/src/animation/system.rs:34-38
The Animator struct is the request to play one graph on one entity, created through the world under the handle
of the entity it poses, usually a skinned renderable.
Build it with Self::new and the ID AnimationSystem::register returned for its graph, then create it with
the entity, as in world.create(mesh).with(Animator::new(graph)). Next, send the states to play with
world.set(request).on(handle) and read the root motion the system posts.
Implementations
-
fn new(graph: AnimationGraphId) -> SelfRelated:
AnimationGraphIdPlays the graph the system registered under
graph. -
const fn with_root_motion(self, settings: RootMotionSettings<'static>) -> SelfRelated:
RootMotionSettingsExtracts root motion from the pose as
settingssay; seeRootMotionSettings. -
const fn with_look_chain(self, settings: LookChainSettings<'static>) -> SelfRelated:
LookChainSettingsTurns a chain of nodes toward the look targets sent to the entity; see
LookChainSettings.
Trait Implementations
impl ArchivePointee for Animator
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Animator
impl Clone for Animator
-
fn clone(&self) -> AnimatorRelated:
Animator
impl Copy for Animator
impl Debug for Animator
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for Animator
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for Animator
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for Animator
impl LayoutRaw for Animator
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Animator
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for Animator
-
fn eq(&self, other: &Animator) -> boolRelated:
Animator
impl Pointee for Animator
-
type Metadata = ()
impl Read for Animator
impl StructuralPartialEq for Animator
impl WithSubscriber for Animator
AnimationGraphId
struct AnimationGraphId();Defined in crates/byte-engine/src/animation/system.rs:68
The AnimationGraphId struct names a graph an AnimationSystem owns, so animators and the application refer to
it without holding it.
Get one from AnimationSystem::register, then pass it to Animator::new.
Trait Implementations
impl ArchivePointee for AnimationGraphId
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for AnimationGraphId
impl Clone for AnimationGraphId
-
fn clone(&self) -> AnimationGraphIdRelated:
AnimationGraphId
impl Copy for AnimationGraphId
impl Debug for AnimationGraphId
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for AnimationGraphId
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for AnimationGraphId
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for AnimationGraphId
impl<K> Equivalent for AnimationGraphId
-
fn equivalent(&self, key: &K) -> bool
impl Hash for AnimationGraphId
-
fn hash<__H: hash::Hasher>(&self, state: &mut __H)
impl Instrument for AnimationGraphId
impl LayoutRaw for AnimationGraphId
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for AnimationGraphId
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for AnimationGraphId
-
fn eq(&self, other: &AnimationGraphId) -> boolRelated:
AnimationGraphId
impl Pointee for AnimationGraphId
-
type Metadata = ()
impl Read for AnimationGraphId
impl StructuralPartialEq for AnimationGraphId
impl WithSubscriber for AnimationGraphId
RootMotionUpdate
struct RootMotionUpdate {
// [REDACTED: Private Fields]
}Defined in crates/byte-engine/src/animation/system.rs:76-81
The RootMotionUpdate struct carries the root motion a step extracted for one animator, for the code that owns
the entity to move it by. The system never moves an entity itself.
Listen on the scope's channel::<RootMotionUpdate>() and read the updates right
after AnimationSystem::step, so the transform you write matches the pose that frame draws.
Implementations
-
const fn handle(&self) -> HandleReturns the entity the animator poses.
-
const fn delta(&self) -> RootMotionDeltaRelated:
RootMotionDeltaReturns the step's root motion delta, in the entity's object space; the identity for an animator without root
motion settings.
-
const fn state(&self) -> Option<AnimationStateId>Related:
AnimationStateIdReturns the state playing after the step, so a route taken this step, like a turn clip handing over, can be
acted on with the pose it produced.
-
const fn waiting_for(&self) -> Option<AnimationStateId>Related:
AnimationStateIdReturns the requested state whose route waits for a moment of the playing clip, such as a frame, or
Nonewhen no route waits.
Trait Implementations
impl ArchivePointee for RootMotionUpdate
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for RootMotionUpdate
impl Clone for RootMotionUpdate
-
fn clone(&self) -> RootMotionUpdateRelated:
RootMotionUpdate
impl Copy for RootMotionUpdate
impl Debug for RootMotionUpdate
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for RootMotionUpdate
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for RootMotionUpdate
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for RootMotionUpdate
impl LayoutRaw for RootMotionUpdate
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for RootMotionUpdate
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for RootMotionUpdate
-
fn eq(&self, other: &RootMotionUpdate) -> boolRelated:
RootMotionUpdate
impl Pointee for RootMotionUpdate
-
type Metadata = ()
impl Read for RootMotionUpdate
impl StructuralPartialEq for RootMotionUpdate
impl WithSubscriber for RootMotionUpdate
AnimationSystem
struct AnimationSystem {
// [REDACTED: Private Fields]
}Defined in crates/byte-engine/src/animation/system.rs:139-156
The AnimationSystem struct plays the animators of a world scope: each step it adopts new ones, applies the
latest request and look target sent to each, advances them together, and posts every pose and root motion.
Create it with Self::new before the animators it must play and register their graphs, then
call Self::step once per frame after your requests for that frame and before the systems that read
transforms, such as Physics::step. Read what each animator plays, and the root
motion to move it by, from the RootMotionUpdate each step posts.
Implementations
-
fn new(scope: &MessageScope, resources: crate::core::EntityHandle<resource_management::resource::resource_manager::ResourceManager>, parameters: impl crate::application::parameters::Parameters) -> (Self, crate::animation::graph::AnimationLoadWorker)Related:
MessageScope,EntityHandle,AnimationLoadWorkerCreates the system and its clip-loading worker before any animators are created in
scope.Pass the application's
animationparameter scope.pool-bytessets the decoded clip budget in bytesand must be nonzero; it defaults to 32 MiB. Invalid values stop startup.
Spawn the returned worker on the loading runtime, then register the graphs to play.
-
fn register(&mut self, graph: AnimationGraph) -> AnimationGraphIdRelated:
AnimationGraph,AnimationGraphIdTakes
graphfor the animators that name it, and returns its ID forAnimator::new. Register a graphbefore creating its animators; an animator whose graph is unknown is reported and never plays.
The system keeps the graph for as long as it lives, and its players share it, so nothing outside needs to.
-
fn step(&mut self, time: Time, alley: &mut Alley)Related:
TimeAdvances every animator by the frame and posts its pose and root motion before returning.
Deleted animators leave and created ones join first; then the latest request and look target sent to each
apply; then the players advance together on
alley's lanes. No other dispatch ofalleymay be running.
Trait Implementations
impl ArchivePointee for AnimationSystem
-
type ArchivedMetadata = () -
fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for AnimationSystem
impl Downcast for AnimationSystem
-
fn into_any(self: Box<T>) -> Box<dyn Any> -
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any> -
fn as_any(&self) -> &dyn Any -
fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSync for AnimationSystem
-
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for AnimationSystem
impl LayoutRaw for AnimationSystem
-
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for AnimationSystem
-
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool -
fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for AnimationSystem
-
type Metadata = ()