Dynamic Tree?

I've noticed a couple of SVN commits that suggest a DynamicTree broadphase is being added!

Does this mean a performance increase? Worlds without a maximum size? I can't find any offical information about it...
Patience. Erin has stated he is updating the broadphase, and it doesn't look done yet. We'll document it once it's settled. In fact, it is likely no documentation is necessary, as it's just an internal detail.

FWIW, he's said the following to me:
Quote:
Yes, I intend to get rid of the limits and world AABB. Also, the new broad-phase should improve scalability and ray-casts.

Whether/how much performance gain there is remains to be seen (or rather, it won't as no one bothers to benchmark in the first place). Certain operations will be O(log n) rather than O(n) (but less than you'd think), but we'll now have to contend with balancing the tree, and pool resize operations. Cache coherence might be worse, too.
The cost in performance is worth it's weight in restriction lifting though, because the worldAABB is such an annoyance.

Thanks, I'll keep my eyes glued to the svn in anticipation!
I'm working on implementing a broad-phase on top of the dynamic tree. For most people this will not be a performance increase.

However, I intend to remove the restrictions on world bounds, proxy count, and pair count. As Boris says, I also plan to provide ray-casting support.

Are you experiencing performance issues in your application?
Erin Catto wrote:
I'm working on implementing a broad-phase on top of the dynamic tree.


So does this mean you're keeping Sort & Sweep (aka Sweep & Prune), but applying it on top of a dynamic tree? Can you explain the theory or provide a reference for learning purposes?

Also, have you considered Christer Ericson's Hierarchical Grid (Hgrid)? He seems to think it's one of the better broadphase methods available, and I'm inclined to believe it would be great for particle collisions. But alas, there is no perfect broadhphase; it really depends upon the application.

How about providing a library of pluggable broadphase methods optimized for different scenarios: S&W, QuadTree, Hgrid....?
Erin Catto wrote:
I'm working on implementing a broad-phase on top of the dynamic tree. For most people this will not be a performance increase.

However, I intend to remove the restrictions on world bounds, proxy count, and pair count. As Boris says, I also plan to provide ray-casting support.

Are you experiencing performance issues in your application?


This is amazing news, thanks Erin!

And no, at least, none attributable to Box2d. 🙂
Zzzzrrr wrote:
Erin Catto wrote:
I'm working on implementing a broad-phase on top of the dynamic tree.


So does this mean you're keeping Sort & Sweep (aka Sweep & Prune), but applying it on top of a dynamic tree? Can you explain the theory or provide a reference for learning purposes?

Also, have you considered Christer Ericson's Hierarchical Grid (Hgrid)? He seems to think it's one of the better broadphase methods available, and I'm inclined to believe it would be great for particle collisions. But alas, there is no perfect broadhphase; it really depends upon the application.

How about providing a library of pluggable broadphase methods optimized for different scenarios: S&W, QuadTree, Hgrid....?


Sweep and Prune will be gone and hopefully not missed.

In Christer's book, I recommend reading the section on incrementally built bounding volume trees. I don't think the dynamic tree will be great for particles. For that I would use a uniform grid (assuming all the particles are the same size). For rigid body simulation, we cannot assume objects are similar in size. Otherwise I would use some sort of grid.

The idea for using a dynamic tree for a broad-phase was developed by Nathanael Presson for the Bullet physics library.

My intention with Box2D is to make a full featured, robust, and efficient rigid body simulator. I know that people would like to have particle and fluid support, but this is outside the scope of my work right now. I don't think this is precluded, but it will require community development.

I'd rather not support multiple algorithms for different components of the engine. Instead, I'd like to pick the best possible algorithm and have it supported as well as possible (avoiding virtual function calls as well). However, I do try to limit dependencies between components, so it should be possible for the community to provide alternate implementations.

Original thread: https://box2d.org/forum/viewtopic.php?t=3141