Hey everyone! I implemented a way of drawing objects partially underwater, but an issue with rotation popped up.
How I do my drawing is I check the depth of the water and draw the top part of the object normally and the part submerged in water (height of the sprite - the water depth) separately. Since these two parts are often different sizes, rotating the object will cause both parts to rotate at different speeds, disfiguring the object.
What I need is a calculation that will change the submerged part's rotation to match with the rotation of the unsubmerged part. Think of two circles with one smaller and one larger. It will take the smaller one less time to complete a full rotation, so it won't be rotating in unison with the larger circle. I need something that, given the rotation value, will modify the smaller circle's rotation value and place it at the same point of rotation as the larger one (Ex. both circles will be at pi/2 rad in 3 seconds as opposed to the smaller circle reaching pi in 3 seconds and the larger one reaching pi/2 in 3).
Thanks in advance!