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?
MOPP analogue
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: MOPP analogue
If you use btDbvtBroadphase, all static objects go in a separate btDbvt tree. It should be efficient.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.
no subtlety, too few resources. Please implement it and provide a patch.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?
Not recommended, btMultiSapBroadphase is unfinished an suboptimal. First option is best.paul.dubois wrote: * use btMultiSapBroadphase; add a SAP for each chunk of the world, containing only that chunk's static data.
We could easily extend the btBvhTriangleMeshShape to accept all types of shapes. Its static acceleration structure is more compact than btDbvt.
Thanks,
Erwin
-
- Posts: 10
- Joined: Thu May 20, 2010 10:45 pm
Re: MOPP analogue
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?
For the record, this is not a good solution because of http://code.google.com/p/bullet/issues/detail?id=348Erwin Coumans wrote: no subtlety, too few resources. Please implement it and provide a patch.