DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ TryValidateHitCursor()

bool CCTLiquid::TryValidateHitCursor ( PlayerBase player,
vector playerPos,
vector hitPosition,
out vector resolvedHitPosition,
out int resolvedLiquidType )
inlineprotected

Saltwater path. This normalizes synced sea hits like <x, 0.546, z> back onto the sea plane.

Freshwater / pond path.

См. определение в файле CCTLiquid.c строка 799

800 {
801 resolvedHitPosition = hitPosition;
802 resolvedLiquidType = LIQUID_NONE;
803
804 if (IsNearlyZero(hitPosition))
805 return false;
806
809 {
810 vector normalizedSeaHit;
811 if (TryGetNormalizedSeaHitPoint(playerPos, hitPosition, normalizedSeaHit))
812 {
813 if (!HasClearPathToLiquidSurface(player, normalizedSeaHit))
814 return false;
815
816 if (!IsCursorActuallyOnLiquidSurface(hitPosition, normalizedSeaHit))
817 return false;
818
819 resolvedHitPosition = normalizedSeaHit;
820 resolvedLiquidType = LIQUID_SALTWATER;
821 return true;
822 }
823 }
824
827 {
828 vector surfacePos;
829 string surfaceType;
830 int detectedLiquidType;
831
832 if (TryValidatePondHitPosition(playerPos, hitPosition, surfacePos, detectedLiquidType, surfaceType))
833 {
834 if (!HasClearPathToLiquidSurface(player, surfacePos))
835 return false;
836
837 if (!IsCursorActuallyOnLiquidSurface(hitPosition, surfacePos))
838 return false;
839
840 resolvedHitPosition = surfacePos;
841 resolvedLiquidType = detectedLiquidType;
842 return true;
843 }
844 }
845
846 return false;
847 }
bool HasClearPathToLiquidSurface(PlayerBase player, vector surfacePos)
Определения CCTLiquid.c:250
bool IsCursorActuallyOnLiquidSurface(vector hitPosition, vector liquidSurfacePos)
Определения CCTLiquid.c:982
bool TryValidatePondHitPosition(vector playerPos, vector hitPosition, out vector surfacePos, out int liquidType, out string surfaceType, int expectedLiquidType=LIQUID_NONE)
Определения CCTLiquid.c:720
bool IsNearlyZero(vector value)
Определения CCTLiquid.c:1024
int m_AllowedLiquidSource
Определения CCTLiquid.c:24
bool TryGetNormalizedSeaHitPoint(vector playerPos, vector hitPosition, out vector normalizedHit)
Определения CCTLiquid.c:569
const int LIQUID_NONE
Определения 3_Game/DayZ/constants.c:566
const int LIQUID_FRESHWATER
Определения 3_Game/DayZ/constants.c:588
const int LIQUID_SALTWATER
Определения 3_Game/DayZ/constants.c:587

Перекрестные ссылки HasClearPathToLiquidSurface(), IsCursorActuallyOnLiquidSurface(), IsNearlyZero(), LIQUID_FRESHWATER, LIQUID_NONE, LIQUID_SALTWATER, m_AllowedLiquidSource, TryGetNormalizedSeaHitPoint() и TryValidatePondHitPosition().

Используется в TryResolveSyntheticCursor() и TryUseCachedSyntheticCursor().