I am using the marching cubes algorithm to procedurally generate a large mesh with extremely non-convex geometry. This is a nightmare for collision and, while the UProceduralMeshComponent does allow automatic collision detection, it is horribly slow. The upside is that I could write my own custom collision code which, due to the structure of the voxel space, would be years faster than the automatic detection provided by the procedural mesh component. Unfortunately, doing this sort of thing seems to be completely undocumented and, dare I say, might involve editing the ue4 source code. I mainly need to know:
- Is there some sort of UPhysComponent I can override to custom handle events like physics collision which will actually be called in the game’s main physics loop?
- If not, do I have to edit ue4 source code?
- If I have to edit ue4 source code, how does the physics pipeline work? I need to figure out where the collision detection is called as well as things like line traces, and shadows. I’m hoping this is all consolidated in something like a PhysicsShape class which has methods like IsCollidingWithPhysicsShape(PhysicsShape other) and I could just create another class derived from PhysicsShape and write my custom code there!