|
As far as I understand it, you should see pretty little performance difference between one static body with many shapes, and many static bodies with one shape; as far as the broad phase is concerned, this is no different.
Now that in 2.0 you can add and remove shapes to a body, there is really little reason to go one way or another. Having one body probably slightly better, but the overheads for adding and removing shapes might be worse for all I know.
Whether you need to dynamically add or remove shapes or can just put them all in at once does depend on your specs, but I think the sweep and prune thing means you have to have really quite large dimensions before it becomes a problem. I would second trying the naïve approach first to actually check there is a problem.
Another option is to rewrite the broadphase manager to treat your tiles as a special case. It is obviously much easier to determine which tiles an AABB is overlapping that it is for other arbitrary rectangles, and you can take advantage of that to have pretty much limitless amounts of static tiles inside the world.
|