oxygengine_animation/
lib.rs

1extern crate oxygengine_core as core;
2
3pub mod animation;
4pub mod curve;
5pub mod phase;
6pub mod spline;
7pub mod transition;
8
9pub mod prelude {
10    pub use crate::{animation::*, curve::*, phase::*, spline::*, transition::*};
11}
12
13use core::Scalar;
14
15pub fn factor_iter(steps: usize) -> impl Iterator<Item = Scalar> {
16    (0..=steps).map(move |index| index as Scalar / steps as Scalar)
17}
18
19pub fn range_iter(steps: usize, from: Scalar, to: Scalar) -> impl Iterator<Item = Scalar> {
20    let diff = to - from;
21    (0..=steps).map(move |index| from + diff * index as Scalar / steps as Scalar)
22}