btStridingMeshInterface TriStrip & TriList

Post Reply
baltic
Posts: 2
Joined: Fri Aug 15, 2008 1:36 am

btStridingMeshInterface TriStrip & TriList

Post by baltic »

btStridingMeshInterface::InternalProcessAllTriangles supports only TriStrips for now, but i've got TriList. i've made a quick hack for myself, but would it be better to include ability to handle TriList, TriStrip, and, maybe, TriFan to that interface? I could do that, if you don't have time.
jezek2
Posts: 40
Joined: Fri Jan 11, 2008 8:33 am

Re: btStridingMeshInterface TriStrip & TriList

Post by jezek2 »

baltic wrote:btStridingMeshInterface::InternalProcessAllTriangles supports only TriStrips for now, but i've got TriList. i've made a quick hack for myself, but would it be better to include ability to handle TriList, TriStrip, and, maybe, TriFan to that interface? I could do that, if you don't have time.
It uses indicies to access vertices, so you can use any topology you want.
baltic
Posts: 2
Joined: Fri Aug 15, 2008 1:36 am

Re: btStridingMeshInterface TriStrip & TriList

Post by baltic »

It assumes that indicies are in TriStrip topology. My index buffer is TriList.
reltham
Posts: 66
Joined: Fri Oct 12, 2007 6:28 pm
Location: San Diego

Re: btStridingMeshInterface TriStrip & TriList

Post by reltham »

It actually assumes TriList. Three indices per triangle.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: btStridingMeshInterface TriStrip & TriList

Post by Erwin Coumans »

The btStridingMeshInterface supports both triangle arrays and triangle strips, you just have to adjust the index striding.

If you want to use index arrays, you can use an index array like this: ABC-BCD-CDE-DEF with index striding 3*sizeof(integer), giving you 4 triangles ABC,BCD,CDE,DEF.
If you want to use index strips, you can use an index array ABCDEF, and use index striding 1*sizeof(integer), giving you the same 4 triangles.

Hope this helps,
Erwin
Post Reply