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

◆ TryGetNormalizedSeaHitPoint()

bool CCTLiquid::TryGetNormalizedSeaHitPoint ( vector playerPos,
vector hitPosition,
out vector normalizedHit )
inlineprotected

Raw Y sanity check. Do not require exact sea Y here because synced cursor Y can differ.

Validate real fishing distance against normalized sea point.

Preserve ValidateDistances() vertical behavior for normalized sea hits.

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

570 {
571 normalizedHit = vector.Zero;
572
573 if (IsNearlyZero(hitPosition))
574 return false;
575
576 if (!g_Game.SurfaceIsSea(hitPosition[0], hitPosition[2]))
577 return false;
578
579 float seaLevel = g_Game.SurfaceGetSeaLevel();
580 float seaLevelMax = g_Game.SurfaceGetSeaLevelMax();
581
583 float hitToSeaHeight = Math.AbsFloat(hitPosition[1] - seaLevel);
584 if (hitToSeaHeight > SEA_HIT_RAW_Y_TOLERANCE)
585 return false;
586
587 if (hitPosition[1] > seaLevelMax + m_MaxVerticalReach)
588 return false;
589
590 normalizedHit = hitPosition;
591 normalizedHit[1] = seaLevel;
592
594 if (vector.Distance(playerPos, normalizedHit) > m_MaxActionDistance)
595 return false;
596
598 float playerToSeaHeight = Math.AbsFloat(playerPos[1] - seaLevel);
599 if (playerToSeaHeight > m_MaxVerticalReach)
600 return false;
601
602 return true;
603 }
DayZGame g_Game
Определения DayZGame.c:4074
bool IsNearlyZero(vector value)
Определения CCTLiquid.c:1024
float m_MaxVerticalReach
Определения CCTLiquid.c:22
float m_MaxActionDistance
Определения CCTLiquid.c:23
static const float SEA_HIT_RAW_Y_TOLERANCE
Определения CCTLiquid.c:14

Перекрестные ссылки Math::AbsFloat(), vector::Distance(), g_Game, IsNearlyZero(), m_MaxActionDistance, m_MaxVerticalReach, SEA_HIT_RAW_Y_TOLERANCE и vector::Zero.

Используется в CheckSeaLevelFallback(), IsSeaHitPositionValid() и TryValidateHitCursor().