Skip to main content

Crate animato_physics

Crate animato_physics 

Source
Expand description

§animato-physics

Input-driven physics for Animato: friction inertia, drag tracking with velocity estimation, and gesture recognition.

§Quick Start

use animato_core::Update;
use animato_physics::{Inertia, InertiaConfig};

let mut inertia = Inertia::new(InertiaConfig::smooth());
inertia.kick(500.0);

while inertia.update(1.0 / 60.0) {}
assert!(inertia.is_settled());

§Feature Flags

FeatureEffect
stdEnables alloc and forwards animato-core/std
allocEnables [InertiaN<T>] and [DragState]
serdeDerives Serialize/Deserialize on public types

Re-exports§

pub use drag::DragAxis;
pub use drag::DragConstraints;
pub use drag::PointerData;
pub use gesture::Gesture;
pub use gesture::GestureConfig;
pub use gesture::GestureRecognizer;
pub use gesture::SwipeDirection;
pub use inertia::Inertia;
pub use inertia::InertiaBounds;
pub use inertia::InertiaConfig;

Modules§

drag
Pointer drag tracking with constraints and velocity estimation.
gesture
Gesture recognition for pointer input.
inertia
Friction inertia for post-drag motion.