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.
Static triangle meshes question
Re: Static triangle meshes question
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.
A couple separated meshes won't hurt too much though if you find yourself wanting to organize it a little differently.
Re: Static triangle meshes question
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.