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

◆ GetClosestSafePos()

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

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

1718 {
1719 vector closest_pos = to_pos;
1720 float smallest_dist = float.MAX;
1721 foreach( array<float> pos:positions)
1722 {
1723 vector vpos = "0 0 0";
1724 vpos[0] = pos[0];
1725 vpos[2] = pos[1];
1726
1727 to_pos[1] = 0;
1728 float dist = vector.DistanceSq(to_pos, vpos);//2d dist sq
1729 if ( dist < smallest_dist)
1730 {
1731 smallest_dist = dist;
1732 closest_pos = vpos;
1733 }
1734 }
1735 return closest_pos;
1736 }
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:119

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