I did a flotation analysis a few years ago, to check whether a vessel would float, and how level it would sit.
Without watching the video linked by dschenken, I suspect the method was similar: calculate the COG position of the complete vessel; assume a water surface plane, calculate the volume and COG of the submerged part of the vessel (using the waterline plane to cut the hull shape); and then use an optimisation feature to set the volume to match the total mass, and to minimise the horizontal offset between the two COGs.
If you get stuck let me know, and I'll try to dig out those old models.