๐๐๐ถ๐น๐ฑ๐ถ๐ป๐ด ๐ ๐ฎ๐ ๐ฃ๐ต๐๐๐ถ๐ฐ๐ ๐๐ป๐ด๐ถ๐ป๐ฒ ๐๐ป ๐ฉ๐ฎ๐ป๐ถ๐น๐น๐ฎ ๐๐ฆ
I built a 2D physics engine using vanilla JavaScript. I used no libraries. I used no build tools. This project uses the Canvas 2D API.
The engine has bugs. These bugs affect stability and speed.
Common problems:
- Objects jitter or sink when stacked.
- Energy disappears during collisions.
- Fast objects pass through each other.
- Performance drops with many objects.
The causes are clear. Stabilization settings are off. Time steps miss fast hits. Sorting objects takes too much time.
Here are the fixes:
- Adaptive tuning stops jitter.
- Sub-stepping fixes energy loss.
- Continuous Collision Detection stops tunneling.
- Spatial partitioning improves speed.
This project is a tool for learning. It shows raw physics mechanics. It needs community help.
Help fix these bugs. Optimize the solver. Add new features.