btStridingMeshInterface TriStrip & TriList
-
- Posts: 2
- Joined: Fri Aug 15, 2008 1:36 am
btStridingMeshInterface TriStrip & TriList
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.
-
- Posts: 40
- Joined: Fri Jan 11, 2008 8:33 am
Re: btStridingMeshInterface TriStrip & TriList
It uses indicies to access vertices, so you can use any topology you want.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.
-
- Posts: 2
- Joined: Fri Aug 15, 2008 1:36 am
Re: btStridingMeshInterface TriStrip & TriList
It assumes that indicies are in TriStrip topology. My index buffer is TriList.
-
- Posts: 66
- Joined: Fri Oct 12, 2007 6:28 pm
- Location: San Diego
Re: btStridingMeshInterface TriStrip & TriList
It actually assumes TriList. Three indices per triangle.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: btStridingMeshInterface TriStrip & TriList
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
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