Spaces:
Running
Running
Download frontend/src/utils/lerp.js from Agmmm/valhalla: direct link, hf CLI and curl.
- Browser
- Download file 454 Bytes
-
https://huggingface.co/spaces/Agmmm/valhalla/resolve/main/frontend/src/utils/lerp.js
- Command line
-
hf download hf://spaces/Agmmm/valhalla/frontend/src/utils/lerp.js
-
curl -L -o lerp.js https://huggingface.co/spaces/Agmmm/valhalla/resolve/main/frontend/src/utils/lerp.js
454 Bytes
| /** | |
| * lerp — exponential interpolation helper for canvas motion. | |
| * | |
| * Moves a value a fixed fraction of the way toward a target each frame, | |
| * producing smooth ease-out movement between tick snapshots. | |
| * | |
| * Architecture: used by SimCanvas to animate agents and camera. | |
| * | |
| * Design: a pure function with no state; callers hold the current value. | |
| */ | |
| export function lerp(current, target, factor) { | |
| return current + (target - current) * factor; | |
| } | |