Skip to main content

fps

Function fps 

Source
pub fn fps(n: u32) -> f64
Expand description

Returns a time delta for a given number of frames per second.

This value can be used as the time delta when initializing a Spring. Note that game engines often provide the time delta as well, which you should use instead of this function if possible.

If n is 0, this returns 0.0.

ยงExample

use harmonica::{fps, Spring};

let spring = Spring::new(fps(60), 5.0, 0.2);