Hi all
How should i use bullet to return the penetration vertices after performing the ConvexHull verse btBvtTriangleMeshShape collision detection .
I will use it for view frustum occlusion and want to know which vertices in the view frustum accurately.
Thanks
-jiangwei
ConvexHull verse btBvtTriangleMeshShape
-
- Posts: 23
- Joined: Wed Nov 30, 2005 11:07 am
- Location: China
-
- Posts: 107
- Joined: Fri Sep 19, 2008 6:08 pm
Re: ConvexHull verse btBvtTriangleMeshShape
you mean the contact points generated by the collision right?
You can provide a callback that bullet will call during the processing of collision - more information here:
http://www.bulletphysics.com/mediawiki- ... d_Triggers
You can provide a callback that bullet will call during the processing of collision - more information here:
http://www.bulletphysics.com/mediawiki- ... d_Triggers
-
- Posts: 23
- Joined: Wed Nov 30, 2005 11:07 am
- Location: China
Re: ConvexHull verse btBvtTriangleMeshShape
That is to say that the penetrated triangles generated by the collision,like the Opcode's PlanesCollider doesmickey wrote:you mean the contact points generated by the collision right?
You can provide a callback that bullet will call during the processing of collision - more information here:
http://www.bulletphysics.com/mediawiki- ... d_Triggers
Thank you
-jiangwei
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: ConvexHull verse btBvtTriangleMeshShape
It is not good to use the ConvexHull for View frustum / occlusion culling.
The best way is to split up the mesh objects into smaller objects and use the btDbvtBroadphase for view frustum culling based on objects instead of triangles. In Extras\CDTestFramework there is a demo using view frustum and occlusion culling. Simply run the demo and enable the view frustum culling options in the dialog. It uses the collideKDOP/collideOCL given the planes (in Extras\CDTestFramework\BulletSAPCompleteBoxPruningTest.cpp).
We might add a similar plane culling method for btBvhTriangleMeshShape in the future, but it will return a huge number of triangles for a large frustum. So again, it is better to split up the mesh and do the culling per-object instead of per-triangle.
Hope this helps,
Erwin
The best way is to split up the mesh objects into smaller objects and use the btDbvtBroadphase for view frustum culling based on objects instead of triangles. In Extras\CDTestFramework there is a demo using view frustum and occlusion culling. Simply run the demo and enable the view frustum culling options in the dialog. It uses the collideKDOP/collideOCL given the planes (in Extras\CDTestFramework\BulletSAPCompleteBoxPruningTest.cpp).
Code: Select all
btDbvt::collideOCL(pbp->m_sets[1].m_root,planes_n,planes_o,dir,acplanes,srenderer);
btDbvt::collideOCL(pbp->m_sets[0].m_root,planes_n,planes_o,dir,acplanes,srenderer);
}
else
{
btDbvt::collideKDOP(pbp->m_sets[1].m_root,planes_n,planes_o,acplanes,srenderer);
btDbvt::collideKDOP(pbp->m_sets[0].m_root,planes_n,planes_o,acplanes,srenderer);
Hope this helps,
Erwin