846 {
847 if (CfgGameplayHandler.GetDisableIsUnderwaterCheck())
848 return false;
849
850 string type;
851 int liquid;
853
855 {
856 #ifdef DIAG_DEVELOPER
857 DebugText("IsUnderwater: ", false, true, " | Surface under object is water");
858 #endif
859 return true;
860 }
861
862
867 float maxSea =
g_Game.SurfaceGetSeaLevelMax() + 0.03;
868 bool belowMaxSea = left_close[1] < maxSea || right_close[1] < maxSea || left_far[1] < maxSea || right_far[1] < maxSea;
869
870 #ifdef DIAG_DEVELOPER
871
872 float lc =
g_Game.GetWaterDepth(left_close);
873 float rc =
g_Game.GetWaterDepth(right_close);
874 float lf =
g_Game.GetWaterDepth(left_far);
875 float rf =
g_Game.GetWaterDepth(right_far);
876 bool isTrue = (lc > 0 || rc > 0 || lf > 0 || rf > 0 || belowMaxSea);
877 DebugText("IsUnderwater: ", false, isTrue, " belowMaxSea: " + belowMaxSea + " | (all must be less than zero) | lc: " + lc + " | rc: " + rc + " | lf: " + lf + " | rf: " + rf);
878
879 if (isTrue)
880 {
881 array<bool> conditions = {lc <= 0, rc <= 0, lf <= 0, rf <= 0};
882 DrawBaseSpheres(conditions);
883 }
884 #endif
885
886 return (belowMaxSea ||
g_Game.GetWaterDepth(left_close) > 0 ||
g_Game.GetWaterDepth(right_close) > 0 ||
g_Game.GetWaterDepth(left_far) > 0 ||
g_Game.GetWaterDepth(right_far) > 0);
887 }
vector GetLeftFarProjectionVector()
vector GetRightFarProjectionVector()
vector GetLeftCloseProjectionVector()
vector GetRightCloseProjectionVector()
const int LIQUID_GROUP_WATER