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

◆ GetClosestSafePos()

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

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

1851 {
1852 vector closest_pos = to_pos;
1853 float smallest_dist = float.MAX;
1854 foreach( array<float> pos:positions)
1855 {
1856 vector vpos = "0 0 0";
1857 vpos[0] = pos[0];
1858 vpos[2] = pos[1];
1859
1860 to_pos[1] = 0;
1861 float dist = vector.DistanceSq(to_pos, vpos);//2d dist sq
1862 if ( dist < smallest_dist)
1863 {
1864 smallest_dist = dist;
1865 closest_pos = vpos;
1866 }
1867 }
1868 return closest_pos;
1869 }
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().