Skip to content

@emile/engine


@emile/engine / math/lerp / lerpOverTime

Function: lerpOverTime() ​

lerpOverTime(engine, a, b, duration, cb): void

Defined in: src/math/lerp.ts:137

Lerps between 2 values over engine updates/ticks.

Parameters ​

engine ​

Engine

The engine to attach the update callback to.

a ​

number

The start value.

b ​

number

The end value.

duration ​

number

The duration of the lerp in seconds.

cb ​

(n) => void

The callback to call with the lerped value.

Returns ​

void