MOPP analogue

Post Reply
paul.dubois
Posts: 10
Joined: Thu May 20, 2010 10:45 pm

MOPP analogue

Post by paul.dubois »

We divide our large world into chunks and wrap all static collision for a chunk into a Hk MOPP. The broadphase contains only a couple static objects -- one for the MOPP, one with a custom heightfield shape.

There seem to be a few possiblilities to do this this in Bullet.

* Forget the container; batch-add all the static objects to the broadphase at runtime.
CON: Makes shifting the broadphase origin more expensive, forces us to build the acceleration structure at runtime.

* Use btCompoundShape with optional dbvt.
CON: ray and sweep tests don't use the acceleration structure (issue 25). Also, seems like a slight abuse of shapes; nobody will care about the combined inertia tensor, for example. Issue 25 looks easy for me to implement, but it _has_ been sitting around for a couple years -- is there some subtlety that I'm missing?

* use btMultiSapBroadphase; add a SAP for each chunk of the world, containing only that chunk's static data.

So, a couple questions:
btMultiSap or btCompoundShape for static collision? Or something else?
Is there anything tricky I'm missing about issue 25?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: MOPP analogue

Post by Erwin Coumans »

paul.dubois wrote:We divide our large world into chunks and wrap all static collision for a chunk into a Hk MOPP. The broadphase contains only a couple static objects -- one for the MOPP, one with a custom heightfield shape.

There seem to be a few possiblilities to do this this in Bullet.

* Forget the container; batch-add all the static objects to the broadphase at runtime.
CON: Makes shifting the broadphase origin more expensive, forces us to build the acceleration structure at runtime.
If you use btDbvtBroadphase, all static objects go in a separate btDbvt tree. It should be efficient.
paul.dubois wrote: * Use btCompoundShape with optional dbvt.
CON: ray and sweep tests don't use the acceleration structure (issue 25). Also, seems like a slight abuse of shapes; nobody will care about the combined inertia tensor, for example. Issue 25 looks easy for me to implement, but it _has_ been sitting around for a couple years -- is there some subtlety that I'm missing?
no subtlety, too few resources. Please implement it and provide a patch.
paul.dubois wrote: * use btMultiSapBroadphase; add a SAP for each chunk of the world, containing only that chunk's static data.
Not recommended, btMultiSapBroadphase is unfinished an suboptimal. First option is best.

We could easily extend the btBvhTriangleMeshShape to accept all types of shapes. Its static acceleration structure is more compact than btDbvt.

Thanks,
Erwin
paul.dubois
Posts: 10
Joined: Thu May 20, 2010 10:45 pm

Re: MOPP analogue

Post by paul.dubois »

paul.dubois wrote: * Use btCompoundShape with optional dbvt.
CON: ray and sweep tests don't use the acceleration structure (issue 25). Also, seems like a slight abuse of shapes; nobody will care about the combined inertia tensor, for example. Issue 25 looks easy for me to implement, but it _has_ been sitting around for a couple years -- is there some subtlety that I'm missing?
Erwin Coumans wrote: no subtlety, too few resources. Please implement it and provide a patch.
For the record, this is not a good solution because of http://code.google.com/p/bullet/issues/detail?id=348
Post Reply