Hello community,
first of all, thank you for Bullet physics, its great library!
We struggle with one annoying problem in our company, hard to say if it is bug or feature. That is also the reason why I didnt post it as an issue, I would like to check it with you first.
Problem description: I have simple scene, the ground is a static rigid body created from compound shape, which is created from:
a) one box 40x40x40m
b) 20x20x20 boxes with 2m size
Scenarios (measured without draw):
1.) I throw one dynamic box (size 2m) onto this ground
a) FPS = 3500, thats ok
b) FPS = 57, why? (aabb tree is enabled at compound shape), FPS is same even when the thrown box is sleeping.
2.) I put character controler on the ground
a) FPS = 3500, thats ok too
b) FPS = 20, this seems like bug for me
I attach also the demo created with BulletSharp, where this behavior can be seen. Is it possible I missed some magic settings anywhere? Or is it just be design of compoundShape?
Thank you for the help,
Petr
Strange compoundShape performance
-
- Posts: 2
- Joined: Wed May 08, 2013 10:30 am
Strange compoundShape performance
You do not have the required permissions to view the files attached to this post.
-
- Posts: 72
- Joined: Wed Feb 24, 2010 9:49 pm
Re: Strange compoundShape performance
I checked whether issue 711 that was recently fixed had anything to do with it, but it didn't seem to speed things up.
The AABB tree of compound shapes is probably not the same as the one in the dynamics world. At least if you add the 20x20x20 boxes individually without the compound shape, then it's much faster. Compound shapes aren't very useful for static objects anyway, so you can do without it here.
What will definitely help is reusing the box shape. Just move "BoxShape groundBox = new BoxShape(1);" out of the internal loop.
The AABB tree of compound shapes is probably not the same as the one in the dynamics world. At least if you add the 20x20x20 boxes individually without the compound shape, then it's much faster. Compound shapes aren't very useful for static objects anyway, so you can do without it here.
What will definitely help is reusing the box shape. Just move "BoxShape groundBox = new BoxShape(1);" out of the internal loop.
-
- Posts: 2
- Joined: Wed May 08, 2013 10:30 am
Re: Strange compoundShape performance
Hello anthrax, thank you for your response.
We suspect aabb tree in compound shape to not work correctly. There is no diference if aabb is enabled/disabled (although at other physics engines this has major performance impact).
This was only bug showing sample, real application uses different convex shapes, not only boxes, and uses this compound as kinematic body.
Best regards,
Petr
We suspect aabb tree in compound shape to not work correctly. There is no diference if aabb is enabled/disabled (although at other physics engines this has major performance impact).
This was only bug showing sample, real application uses different convex shapes, not only boxes, and uses this compound as kinematic body.
Best regards,
Petr