Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

(This question was split off from http://gamedev.stackexchange.com/questions/3345/)

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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!

share|improve this answer
    
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? –  bluescrn Sep 1 '10 at 9:15
    
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) –  speeder Sep 2 '10 at 5:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.