Find the volume of an object that is underneath a mesh
I'm trying to code some buoyancy logic.
I have a boat, so an object with an irregular volume, and a procedurally generated mesh (using perlin noise) which simulates the motion of waves.
And as such, I need to find the volume of my boat that is underneath the mesh/water/waves.
In the end, I would also want to divide the underwater volume of my boat in 4 quadrants (the front-right portion of volume of the boat, the front-left, the back-right and the back-left.....) so that I can create 4 separate buoyancy forces which would also create a torque effect on my boat and make it sway and not just float rigidly.
How could I find those 4 volumes, or at least the total volume of my boat that is underwater?
(I have not yet created my boat and for testing I'm just using a scaled cube, if that's of any importance)
Furthermore, is there an easier way to simulate the floating of a boat on moving waves?