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: