(This question was split off from 3D collision-detection middleware)

Are there any recommendable middleware available for 2D collision detection?

I believe I've heard that Box2D could be used for collision detection without the physics part. I'd like to hear if people have any experiences on Box2D or others libraries for 2D collision detection specifically.


1 Answer 1


I had SEVERE issues with Box2D collision detection...

Mostly, because Box2D collision detect broadphase is a binary tree, everything that use collision (even if they don't use physics) need to update that tree, and then the tree need to be searched back.

For few objects with bizarre size differences (like a golf ball and a bus), Box2D is acceptable, or even fast, but for various objects of roughly the same size (like you would have in a clone of asteroids, or in a tile-based game, or anything like that) then it behaves extremely slow, even unstable sometimes as it need to write and read massive amounts of data on the tree.

Chipmunk Physics fix this, they use a spatial hashing thing, that I really don't understand how it work, but it work!

  • \$\begingroup\$ Chipmunk is cool as a 2D physics engine - but last time I looked, which was admittedly the best part of 2 years ago, there was no easy way of manually doing collision queries (e.g. raycasts, intersection tests). Has support for that sort of thing been added yet? \$\endgroup\$
    – bluescrn
    Sep 1, 2010 at 9:15
  • \$\begingroup\$ Yes :) Many people complained, so they added it. (at least, raycast...) Also they added a way that allow you do delete a object from inside a collision (something that before crashed the game) \$\endgroup\$
    – speeder
    Sep 2, 2010 at 5:30

Not the answer you're looking for? Browse other questions tagged .