Hi Norbo and thanks again for these clarifications. They are really useful and if I may give you a small advice, you should spend some time combining such content in a small web page in your main site in a FAQ for instance
I'll probably be adding more types of documentation after the website gets a ground-up revamp
And finally, I'm not sure to understand right your first paragraph, the broadphase that performs a first test against OBB Boxes can be intercepted before it goes deeper in the Entity collision tests?
The broadphase is just a system to find entities with overlapping AABB's. If two entities do not have overlapping AABB's, the narrow phase detailed collision test will not be run. So, the broadphase will determine which entities overlap with the ship-wrapping Box entity's AABB. Only entities with AABB's that overlap the Box's AABB will be tested against the Box itself. The Box collision test will generally be superfluous and may slow things down- though there are other reasons to have the Box entity (like how it is used in option 1 below).
Here's the main approaches I'd consider:
1) When some entity that wraps the ship has a CollisionPair with a bullet (doesn't need to do an actual narrow phase test against the box, chances are if it overlaps the AABB it's good enough), test that bullet against a more detailed representation which is only updated when collisions occur.
Advantages:
-Can support triangle-wise collision by querying a TriangleMesh object as the detailed representation. Would need to manually call some of the Toolbox's collision tests to see if Triangles from the TriangleMesh collide with the bullet.
-Avoids continually updating a large number of entities or refitting shapes except when collisions actually occur. Could avoid doing any refits by instead transforming incoming bullets to the local space of the collision mesh for testing purposes.
Disadvantages:
-Does not support continuous collision detection.
-Requires doing a good bit of manual work.
-Figuring out which part of the ship was hit can be tricky.
2) Have a CompoundBody composed of multiple ConvexHulls. Each ConvexHull wraps a reasonable part of your ship's mesh (or a simpler collision mesh). Note that this isn't a single ConvexHull, since a single ConvexHull removes any concavity from the mesh. This CompoundBody provides you the world transform for rendering as well.
Advantages:
-The multiple convex hulls allow you to attach individual collision events. Instead of intercepting a collision and then figuring out where it was, you could hook an event on the "engines" or "cockpit" shape directly.
-With a reasonable number of ConvexHulls, will be fast.
-Doesn't require manually calling collision tests; the broadphase and CompoundBody's own acceleration structure will take care of only doing narrow-phase tests on the right parts of the ship.
Disadvantages:
-The transforms of all sub-entities in the CompoundBody are necessarily being changed each frame. This is more expensive than working on a single entity, but if you stick to a reasonable number of hulls, it won't be an issue. Moving 10 sub-entities around won't be a problem.
3) Similarly to #2, have a CompoundBody composed of multiple primitives like Box, Sphere, Cylinder, etc. This has most of the same advantages/disadvantages as #2, but could be nicer depending on your preference. Some primitive tests like sphere-sphere collision detection also have faster narrow-phase tests, though this won't play a big role in overall performance since most of your collisions are extremely brief impacts.
Personally, I lean more towards option 2 or 3 than 1 mainly because of the ease of implementation and management.