btbvhtrianglemeshshape on separated objects

Post Reply
Posts: 12
Joined: Fri Aug 11, 2017 1:16 pm

btbvhtrianglemeshshape on separated objects

Post by teolazza » Tue Jan 15, 2019 3:19 am


in my world I have many flying islands that won't move. They are separated by empty space.

Up to now I have been using one btBvhTriangleMeshShape for each island. Each mesh has from 30 to 80 vertices. I have about 20 islands.
I need as many frames per second as possible because I am writing a simulator, so performance speed is very important.

The bullet manual says that "Many small btBvhTriangleMeshShape pollute the broadphase. Better combine them".

Can I safely combine all the btBvhTriangleMeshShape that describe my islands into a single btBvhTriangleMeshShape even if they are separated islands?


Posts: 7
Joined: Sun Mar 11, 2018 9:34 am

Re: btbvhtrianglemeshshape on separated objects

Post by niad » Tue Jan 15, 2019 9:28 am

That would probably just create a giant entry in the broadphase, that everything would overlap, and slow your program down-

With only 30-80 verts, that sounds like a very low detail mesh, you could probably use convex hulls.

Triangle meshes tend to be easy to penetrate since they are just surfaces and have no volume, another reason to use hull instead.

Bullets broadphase isn't that bad for static stuff, you can stick plenty of TriangleMeshes/Hulls etc into it-- ie don't worry about it for now..

User avatar
Posts: 527
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: btbvhtrianglemeshshape on separated objects

Post by drleviathan » Wed Jan 16, 2019 3:33 pm

When you add lots of Objects to the World, the cost of adding/removing each successive Object goes up. I hear this doesn't really become noticeable until you have a few tens of thousands of Objects, however on various hardware mileage will vary.

If you aren't constantly adding/removing Objects to the World AND you don't have too many Objects then I would expect multiple static Objects would win over one big one. The broadphase culling benefits would outweigh the narrowphase collision check.

When using many static Objects the first thing you want to do is to NOT constantly update their Aabb's, which is done by default. That is, you want to do this:

Code: Select all

However, when you do that: whenever you need to move a static Object to a new Transform you must manually update its Aabb like so:

Code: Select all


Post Reply