StaticMesh With Large Mesh
Posted: Tue Jan 28, 2014 2:04 am
It's been a long time since I first integrated BepuPhysics into my XNA game, and I really appreciate the engine. I recently, however, ported to MonoGame and so I rebuilt BepuPhysics with implicit type conversions to MonoGame types. This works great except for one thing: StaticMeshes.
The older BepuPhysics version I used for years was very fast at creating a StaticMesh structure out of even a very detailed mesh, but with the latest bits the load time for highly detailed meshes is much higher, and it throws a stack overflow on MeshBoundingBoxTree.InternalNode.GetOverlaps(...). I use collision hulls with simpler hull meshes for other ships and those work fine, but creating an accurate set of hulls would be a ton of work for this behemoth.
To be precise this code is:
Any suggestions to get past this? Is my only option to decompose my huge meshes into cleaner hulls?
The huge model I'm referring to is the big ship in this image:

The older BepuPhysics version I used for years was very fast at creating a StaticMesh structure out of even a very detailed mesh, but with the latest bits the load time for highly detailed meshes is much higher, and it throws a stack overflow on MeshBoundingBoxTree.InternalNode.GetOverlaps(...). I use collision hulls with simpler hull meshes for other ships and those work fine, but creating an accurate set of hulls would be a ton of work for this behemoth.
To be precise this code is:
Code: Select all
TriangleMesh.GetVerticesAndIndicesFromModel(Model, out vertices, out indices);
ExactMesh = new StaticMesh(vertices.ToArray(), indices, new AffineTransform { Matrix = World });
The huge model I'm referring to is the big ship in this image:
