Function drift

WIP Returns a Drifter that moves a value over time.

It keeps track of how much time has elapsed, accumulating driftAmtPerMs. The accumulated drift is wrapped on a 0..1 scale.

// Set up the drifer
const d = drif(0.001);

d.update(1.0);
// Returns 1.0 + accumulated drift
  • Parameters

    • driftAmtPerMs: number

    Returns Drifter