btCompoundShape performance

Ronin
Posts: 15
Joined: Fri Oct 06, 2006 9:36 am

btCompoundShape performance

Post by Ronin »

Hi,

I have complex concave trimeshes which I subdivide in convex parts with less then 100 vertices. The whole mesh can have up to 5000 or 10000 polygons. In the narrow phase cd I encounter a heavy performance hit, when 2 objects are about to colliding (space scenario so no gravity or damping).

My question: What is the best approach for this? I read a lot in this forum and the source code either, it seems to me that there are several algorithms for narrow phase inside bullet, but I have no clue how to select a certain one.

Which algorithm is best used for complex compound convex shapes in narrow phase and how do I utilize it?

Hope I made myself reasonably clear and anyone can put me on the right direction on this one.

Cheers,
Ronin

Edit: Forgot to mention that I use Bullet in double precision... That could also contribute to the performance hit...
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: btCompoundShape performance

Post by Erwin Coumans »

Renamed the issue into btCompoundShape, because it is not narrow phase related.
Right now, btCompoundShape is not optimized for many sub parts, but we will do this.
http://code.google.com/p/bullet/issues/detail?id=52

Until then, if you need many parts for a compound shape, please consider using btGImpactShape, see MovingConcaveDemo.

For static (non-moving) shapes, please use btBvhTriangleMeshShape.
Thanks for the feedback,
Erwin
Ronin
Posts: 15
Joined: Fri Oct 06, 2006 9:36 am

Re: btCompoundShape performance

Post by Ronin »

Thanks for your advise Erwin, I tested btGImpactShape, the results are much better as with btConvexHullShape. Unfortunately it is still too slow. I need collisions between rather detailed collision meshes (e.g. a fighter landing on a carrier flight deck) and sadly the relative velocities between the objects and the mass ratios can both become somewhat large. I think this is the worst case for a physics engine to handle. :?

I don't want you to do all the work for me though. In fact I'm keenly interested in contributing by myself. This is part of my diploma thesis in computer science, so I have both time and willpower to do everything needed to accomplish the task. Of course I do not have the understanding about simulation algorithms that you Erwin and other users in this forum have, so it would be nice, if you could give me some advice. First of all, if you think that this is even possible on todays computer hardware and maybe you can give me a hand in starting the research about this topic. Maybe a starting point in where first optimization could kick in or papers about a faster algorithm that could be implemented or anything else.

You see I would appreciate every advice on improving the collision of convex decomposed compound shapes with up to some thousand polygons in reasonable time.

Really looking forward to tackle this task... :D

Cheers,
Ronin