interpolated 0.1.0

Generic, smooth value interpolation and easing functions for Rust.
Documentation
  • Coverage
  • 91.67%
    11 out of 12 items documented7 out of 7 items with examples
  • Size
  • Source code size: 15.86 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.69 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Staninna

interpolated

Generic, smooth value interpolation and easing functions for Rust.

This crate provides the Interpolated<T> type for animating values of any arithmetic type over time using customizable easing functions.

Usage

Add to your Cargo.toml:

[dependencies]
interpolated = "0.1.0"

Import and use in code:

use interpolated::{Interpolated, linear};
use std::time::Duration;

let mut value = Interpolated::new(0.0f32);
value.set_duration(Duration::from_secs_f32(1.0));
value.transition = linear;
value.set(10.0);
// In an update loop:
let current = value.value();
println!("Current: {}", current);