Auto generate simple collision mesh for complex objects that do not have a collision mesh
Coming out of the discussions in #6352, #5577 (closed) and on discord internally and with TR; there is a desire to see OpenMW do the following: create a simple collision mesh for complex objects that do not have collision meshes of their own.
So we go through the checklist:
- does the object not have a collision mesh
- does any part of an object's volume of 1 cubic yard (meter?) exceed 1000 triangles (or better metric?)
- warn the user about the object that is highly detailed and will cause performance issues
- create a cube/sphere/capsule collision mesh for that object based on its max x,y,z dimensions
This is a quick and dirty solution, but should it prove useful we can further refine this in another MR that segments and simplifies the meshes to feed into Bullet.
This should forgo the need for !1317 (merged), satisfy TR (and modders) that they are made aware of assets that don't have collision meshes so they can be fixed.
This does not mean we shouldn't pursue better ways of using Bullet and seeing if it can't be improved upstream as well. If we that does happen, we can make the triangle threshold higher.
If this works out well, we can probably do an additional check if the asset's collision mesh is also above some threshold to also warn about that.