Expand description
§animato-path
Motion-path primitives for Animato.
This crate provides Bezier curves, CatmullRom splines, compound paths,
SVG d attribute parsing, and [MotionPathTween] for driving an object
along a path with the existing tween system.
§Quick Start
ⓘ
use animato_core::{Easing, Update};
use animato_path::{CubicBezierCurve, MotionPathTween};
let path = CubicBezierCurve::new(
[0.0, 0.0],
[50.0, 100.0],
[150.0, -100.0],
[200.0, 0.0],
);
let mut motion = MotionPathTween::new(path)
.duration(1.0)
.easing(Easing::EaseInOutSine)
.auto_rotate(true)
.build();
motion.update(0.5);
let position = motion.value();
assert!(position[0] > 0.0);§Feature Flags
| Feature | Effect |
|---|---|
std | Enables all path types and forwards std to dependencies |
alloc | Enables heap-backed paths, SVG parser, and MotionPathTween |
serde | Derives Serialize/Deserialize on supported public types |
Re-exports§
pub use bezier::CubicBezierCurve;pub use bezier::PathEvaluate;pub use bezier::QuadBezier;
Modules§
- bezier
- Bezier curves, CatmullRom splines, and the
PathEvaluatetrait.