velocity-per-second.mjs 278 B

1234567891011
  1. /*
  2. Convert velocity into velocity per second
  3. @param [number]: Unit per frame
  4. @param [number]: Frame duration in ms
  5. */
  6. function velocityPerSecond(velocity, frameDuration) {
  7. return frameDuration ? velocity * (1000 / frameDuration) : 0;
  8. }
  9. export { velocityPerSecond };