Need review on my idea of how buoyancy could work for my water system (and also some help maybe)

Hey there.

So basically I’m working on a water system. When an object submerges the volume of water it displaces needs to be calculated to know how much force should be applied. I’ve seen some posts about calculating overlapping geometry’s volume but that basically said to have a lot of points and see which are overlapping which would be horribly expensive on a larger scale I must imagine.

I came up with the idea to have just a few points, line trace to their submerged neighbours and then from break hit result get the points at which the object and water collide. Having all these points would hopefully allow me to get the volume of displaced water which later would be used to calculate the point at which buoyancy should be applied and the buoyancy itself.

Here’s an example with a box in 2d space:

I think I can get the logic behind tracing lines to neighbouring points and everything else. My problem is placing the points. I don’t want to have to place each of these points individually and define it’s neighbours. I need a system that will allow me to place a component into the viewport, define it’s original shape and then let me move those points if the mesh is more complex (fe. a ship). Obiously I also need access to each point’s location and neighbours. I tried using spline component for that but quickly realized that each of it’s points can only have up to two neighbours. I have no idea where should I even start with developing such a system.

Hopefully everything was presented clearly and you guys understood.