Run this little script. It fires a lineIntersects underwater from a point in open water, through a pier object (on Altis)
_eyePos = [15514.2,15782.3,-6.1243];
_worldPosASL = [15515.6,15772.4,-8.97415];
diag_log format ["EYE POS: %1",_eyePos];
diag_log format ["WORLD POS ASL: %1",_worldPosASL];
_helper = createVehicle ["Sign_Sphere25cm_F",[0,0,0],[],0,"CAN_COLLIDE"];
_helper setPosASL _eyePos;
_helper setObjectTexture [0,"#(argb,8,8,3)color(1,0,0,1)"];
_helper = createVehicle ["Sign_Sphere25cm_F",[0,0,0],[],0,"CAN_COLLIDE"];
_helper setPosASL _worldPosASL;
_helper setObjectTexture [0,"#(argb,8,8,3)color(1,0,1,1)"];
_intersect = lineIntersects [_eyePos,_worldPosASL];
diag_log format ["INTERSECT ?: %1",_intersect];
If you change the z values to a position above the waves, then intersect is returned as true (as expected).
For example:
"EYE POS: [15514.2,15782.3,2]"
"WORLD POS ASL: [15515.6,15772.4,2]"
"INTERSECT ?: true"
In the above example, the object in the way is: 6da16b00# 541923: pier_box_f.p3d