1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! # animato-spring
//!
//! Physics-based spring animations using a damped harmonic oscillator.
//!
//! - [`Spring`] — 1D spring, stack-allocated, `no_std`-compatible.
//! - [`SpringConfig`] — stiffness / damping / mass / epsilon, with named presets.
//! - [`SpringN<T>`] — multi-dimensional spring (requires `alloc` feature).
//!
//! ## Quick Start
//!
//! ```rust
//! use animato_spring::{Spring, SpringConfig};
//! use animato_core::Update;
//!
//! let mut spring = Spring::new(SpringConfig::wobbly());
//! spring.set_target(200.0);
//!
//! let mut steps = 0;
//! while !spring.is_settled() {
//! spring.update(1.0 / 60.0);
//! steps += 1;
//! assert!(steps < 10_000, "spring should settle");
//! }
//! let pos = spring.position();
//! assert!((pos - 200.0).abs() < 0.01);
//! ```
//!
//! ## Feature Flags
//!
//! | Feature | Effect |
//! |---------|--------|
//! | `std` | Enables `alloc` and `animato-core/std` |
//! | `alloc` | Enables [`SpringN<T>`] (multi-dimensional spring) |
//! | `serde` | Derives `Serialize`/`Deserialize` on public types |
extern crate alloc;
pub
pub use SpringConfig;
pub use ;
pub use SpringN;