Feedback: Updated to 2.1.2

Hello Erin and fellow contributers,

I was just updating to the new 2.1.2 and wanted to pass some feedback.


The Good:
I totally love the new Set* and Get* methods you put on b2Body, like SetBullet. Now I don't have to recreate the entire body when these values must change =).

It's also great that the shape limit is virtually gone.

The dynamic AABB is pure bliss, this potentially saves me a ton of work (I was gonna go for a circle tree).

Being able to say when debug feedback should be drawn. I worked around this problem last time and it took quite some work.


The Bad:
No AABB tree feedback. What is the level depth? How to optimize my level and get rid of islands?

The b2Fixture thing is kind of confusing I must say. Why does it use pimpl to wrap b2Shape and why is it not simply part of b2Shape? It screwed up most of my wrappers.

Another thing is that it's easy to copy shapes now between bodies, but not fixtures. But since a fixture explains so much about a shape it kind of useless to me. I wrote a wrapper function for creating a b2FixtureDef out of a b2Fixture, and use that to copy it.

In b2WorldCallbacks.h you declare an unused sturct:
struct b2ContactPoint;


Here are some tests I did, the bodies are randomly placed:

Cpu: Double core 2.21GHz AMD Athlon 64
Profiler: Shiny
Timestep: 1 / 60
Iterations: 10
World Size: 20000 quad
Static Shapes: 30000
Step performance: 22ms

Static Shapes: 10000
Step performance: 9ms

Dynamic Shapes: 10000
Step performance: 9ms

World Size: 2000 quad
Dynamic Shapes: 1000
Step performance: 0.5ms

World Size: 2000 quad
Static Shapes: 20000
Step performance: 14ms

Iterations: 1
Step performance: 14ms

Why does the amount of static bodies slow down the step so much? They cannot collide, and even if I would put in dynamic bodies there's the AABB tree to prune most of them.


Thanks again for all the great work! It is really helpful and I will share more details about our project in the next year.

Antoon


P.S. I am getting MySQL errors when I try editing posts, so I e-mailed [email hidden] but that e-mail does not exist.
xilliah wrote:
No AABB tree feedback. What is the level depth? How to optimize my level and get rid of islands?


The SVN version has some big improvements to the dynamic AABB tree. There is a test called Tiles that you can look at. Still there is work to do, the performance is poor when many objects are create sequentially in a row.

xilliah wrote:
The b2Fixture thing is kind of confusing I must say. Why does it use pimpl to wrap b2Shape and why is it not simply part of b2Shape? It screwed up most of my wrappers.


The introduction of fixtures allow shapes and collision algorithms to be used independently of b2World. For example, someone might want to know the distance between two shapes without creating bodies. It is not pimpl.

xilliah wrote:
Why does the amount of static bodies slow down the step so much? They cannot collide, and even if I would put in dynamic bodies there's the AABB tree to prune most of them.


Please provide a testbed demo that illustrates this. I could probably guess at something, but I'd like to address your particular problem.

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