grid based Broadphase

Marc
Posts: 6
Joined: Wed Jul 15, 2009 11:39 pm

grid based Broadphase

Post by Marc »

Hi !

I'm quite new to bullet and I was wondering: There are three cpu based broadphases implemented. As far as I understand, Dbvt uses some kind of hierarchical tree, AxisSweep sorts the objects along axis and simple probably just does something inefficient.

Is there a reason why there isn't a grid based broadphase? I'ld assume, that'ld be quite fast. It wouldn't be efficient for all types of scenes, but for the usual "human and vehicle sized things move around on heightfields/in buildings" I can imagine it working well.

There is a thread about an experimental Multi Sap that puts a grid on top of several SAP. So tehre is already something grid like there. Mabye the code is there and I missed it?

If you use a 3D hashed/sparse grid once can insert n objects there in O(n), then check the neighbourhood of each object for possible pairs in something like O(n * volume of the object). If the volume of objects don't differ too much, that's a constant you can optimize by adjusting the grid size and you get O(n) for the whole broadphase while SAP because of the sorting is at least O(n log n) and the hierachical tree Dbvt feels like O(n log n) as well.

Am I missing something?