Hacker News new | past | comments | ask | show | jobs | submit login

While having a quick look at the sources, I learned about the quadtree: http://de.wikipedia.org/wiki/Quadtree. agar.io is using this implementation: https://github.com/silflow/quadtree-javascript to optimize collision detection performance.



Quad trees are popular because they're fairly easy to understand and implement, but they don't actually perform that well in practice for broadphase. (Its really more for LOD)

If you want a tree that does perform well and is similarly easy to understand, a dynamic AABB tree is much better.


Good find. Another nifty JS implementation of collision detection is https://jriecken.github.io/sat-js/ - I have used that one for tricky gaming and drag&drop behaviours.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: