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

◆ GetClosestSafePos()

static vector GetClosestSafePos ( vector to_pos,
notnull array< ref array< float > > positions )
staticprotected

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

1705 {
1706 vector closest_pos = to_pos;
1707 float smallest_dist = float.MAX;
1708 foreach( array<float> pos:positions)
1709 {
1710 vector vpos = "0 0 0";
1711 vpos[0] = pos[0];
1712 vpos[2] = pos[1];
1713
1714 to_pos[1] = 0;
1715 float dist = vector.DistanceSq(to_pos, vpos);//2d dist sq
1716 if ( dist < smallest_dist)
1717 {
1718 smallest_dist = dist;
1719 closest_pos = vpos;
1720 }
1721 }
1722 return closest_pos;
1723 }
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
Определения EnConvert.c:106

Перекрестные ссылки vector::DistanceSq().