3 ms·
Point and Spring Simulation
- bemmu 11y agoCalling requestAnimationFrame again after drawing the previous frame gives smoother results, no need for setInterval. You can know how much to update the physics by seeing how much Date.now() has changed since the previous frame.
- ichub 11y agoThanks for the suggestion, I implemented it: https://github.com/ichub/physics/commit/5b875ea2d5e3dfa3f5a0da5ba2e701c977de94cd https://github.com/ichub/physics/commit/5b875ea2d5e3dfa3f5a0...