Skip to main content

viewport_lib/runtime/plugins/
mod.rs

1//! Built-in runtime plugins: animation, constraints, simple physics, and
2//! skeletal animation.
3//!
4//! All plugins implement [`crate::RuntimePlugin`] and are registered on
5//! [`crate::ViewportRuntime`] via [`crate::ViewportRuntime::with_plugin`].
6//!
7//! # Layout convention
8//!
9//! New plugins live in their own subdirectory under `plugins/`, not as a single
10//! file. Use the [`skeleton_plugin`] module as the template:
11//!
12//! ```text
13//! plugins/
14//!   my_plugin/
15//!     mod.rs        // re-exports the public surface
16//!     plugin.rs     // the RuntimePlugin impl
17//!     <feature>.rs  // substrate types, math, helpers, internal state
18//! ```
19//!
20//! Rationale: features grow. A plugin that starts as a single file invariably
21//! accumulates substrate types, helper modules, and tests. Starting in a
22//! subdirectory avoids a later rename-and-rewire that breaks `use` paths
23//! across the codebase. It also keeps each plugin's surface area discoverable
24//! in one place rather than scattered between `runtime/<feature>.rs` and
25//! `runtime/plugins/<feature>.rs`.
26//!
27//! All plugins follow the subdirectory layout. Use the [`skeleton_plugin`] module
28//! as the template for new plugins.
29
30pub mod animation;
31pub mod constraint;
32pub mod physics_lite;
33pub mod skeleton_plugin;
34
35pub use animation::{AnimationPlugin, AnimationTrack, Keyframe};
36pub use constraint::{Constraint, ConstraintPlugin};
37pub use physics_lite::{PhysicsBody, PhysicsLitePlugin};
38pub use skeleton_plugin::{
39    AnimationClip, Channel, ClipPlayerPlugin, Interpolation, Joint, JointMatrices, MAX_JOINTS,
40    Pose, Sampler, Skeleton, SkeletonPlugin, SkinnedActor, SkinnedActorPart, SkinnedActorPlugin,
41    SkinningPath, Track, TrackValue, TrackValues, apply_skin,
42};