ConvexHull verse btBvtTriangleMeshShape

Post Reply
jiangwei
Posts: 23
Joined: Wed Nov 30, 2005 11:07 am
Location: China

ConvexHull verse btBvtTriangleMeshShape

Post by jiangwei »

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
mickey
Posts: 107
Joined: Fri Sep 19, 2008 6:08 pm

Re: ConvexHull verse btBvtTriangleMeshShape

Post by mickey »

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
jiangwei
Posts: 23
Joined: Wed Nov 30, 2005 11:07 am
Location: China

Re: ConvexHull verse btBvtTriangleMeshShape

Post by jiangwei »

mickey 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
That is to say that the penetrated triangles generated by the collision,like the Opcode's PlanesCollider does
Thank you
-jiangwei
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: ConvexHull verse btBvtTriangleMeshShape

Post by Erwin Coumans »

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).

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);		
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
Post Reply