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

◆ GetClosestSafePos()

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

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

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