I am currently working on a SpeedTree 5.0 integration.
As you might know, speedtree API gives access to a collision shape for each tree instance, being made of some capsule shapes.
Now, I wonder what would be the best way to implement this using bullet - imagine a forest of 100 trees, each being made of 5 capsules
- create a rigid body for each capsule => 500 rigid bodies with capsule shape
- create a compound shape for each tree => 100 rigid bodies with compound shape
- create one single coumpound shape for the whole forest => 1 rigid body with compound shape (500 capsule child shapes)
My concerns are mainly about performance, as I am not sure how bullet will handle this internally (one can consider the tree being static, there fore they will be inactive most of the time ?).
Now, I assume the first option is the worst one.
The third option is great when nothing moves, as there are quite a few object intersections to test. However, in the case a vehicle is driving through the forest, each capsule will have to be tested.
So to me it seems the second option would be the best one, however, the CPU overhead is quite important (OK, I have a *huge* forest). See the profiler results below. Any idea how I could improve this ?

Thanks for any input.
Cheers,
Greg
