Static triangle meshes question

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Danthekilla
Posts: 136
Joined: Sun Jan 17, 2010 11:35 am

Static triangle meshes question

Post by Danthekilla »

In our editor we can play some static objects that use trangle meshs, would it be more efficent if at loadtime we then combined all the static triangle meshs into one larger one?
I assume they are using a quadtree internally? Would it be much faster with them all being in one?
If so do you have any ideas or hints on how I should go about trying it.

Thanks in advance.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Static triangle meshes question

Post by Norbo »

It should be faster to combine them all into one. Currently, each mesh uses a broadphase query to collect possibly colliding entities. The less queries needed, the faster it will be. The bounding volume hierarchy can deal with a large number of triangles in a single mesh.

A couple separated meshes won't hurt too much though if you find yourself wanting to organize it a little differently.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Static triangle meshes question

Post by Norbo »

To combine the meshes, you can do something similar to what the getVerticesAndIndicesFromModel does internally. For each separate mesh, it collects the vertices and indices. The indices for each object are offset by the iteration's starting vertex list size since the vertex buffers are being combined.
Post Reply