compound shape / dynamic AABB tree question

Post Reply
gjaegy
Posts: 178
Joined: Fri Apr 18, 2008 2:20 pm

compound shape / dynamic AABB tree question

Post by gjaegy »

Hi,

This might sound like a terrible question, but I'm not fully sure of the answer.

The compound shape constructor has a "enableDynamicAabbTree" parameter. That tree is used to accelerate early rejection.

In the case all shapes added to a compound shape are static (i.e. not moving), does that AABB tree still help with performance ? I guess it does, I assume "dynamic" means the bounding volume hierarchy is based on a dynamic space partition (vs. its purpose being dynamic children handling), but could anyone confirm this ?

Thanks,
Greg
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: compound shape / dynamic AABB tree question

Post by drleviathan »

Yes, the dynamic AABB tree helps, even for static compound shapes, especially for compound shapes with many child shapes. It is used in the narrowphase collision calculation to cull the number of contact point candidates.

The only reason to NOT enable the dynamic AABB tree would be for a compound shape has only a few child shapes, when the unrolled "check every child shape" algorithm is faster than the overhead of storing the tree structure and performing queries against it. However I don't know where the transition would happen: 4, 8, 16,... children? You would have to run benchmarks to figure it out.
Post Reply