MCPcopy Create free account
hub / github.com/melonjs/melonJS / lerpSim

Function lerpSim

packages/melonjs/tests/math.spec.js:187–193  ·  view source on GitHub ↗
(steps)

Source from the content-addressed store, hash-verified

185 // total time.
186 const target = 100;
187 const lerpSim = (steps) => {
188 let x = 0;
189 for (let i = 0; i < steps; i++) {
190 x = math.lerp(x, target, 0.1);
191 }
192 return x;
193 };
194 const at60 = lerpSim(60); // 1 second @ 60 fps
195 const at30 = lerpSim(30); // 1 second @ 30 fps
196 // These ARE different, demonstrating the broken-ness:

Callers 1

math.spec.jsFile · 0.85

Calls 1

lerpMethod · 0.45

Tested by

no test coverage detected