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

◆ SplitArrayIntoGroupsByDistance()

static void SplitArrayIntoGroupsByDistance ( array< Object > objects,
array< ref array< Object > > objectGroups,
float squaredDistanceDelta )
staticprotected

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

1418 {
1419 array<Object> group;
1420 for ( int i = 0; i < objects.Count(); )
1421 {
1422 Object obj1 = objects[i];
1423 if ( obj1 )
1424 {
1425 group = new array<Object>;
1426 group.Insert(obj1);
1427 for ( int j = objects.Count() - 1; j > i; --j )
1428 {
1429 Object obj2 = objects[j];
1430 if ( obj1 && obj2 )
1431 {
1432 vector start = obj1.GetWorldPosition();
1433 vector end = obj2.GetWorldPosition();
1434
1435 float distance = vector.DistanceSq(start, end);
1436 if ( distance < squaredDistanceDelta )
1437 {
1438 group.Insert(obj2);
1439 objects.Remove(j);
1440 }
1441 }
1442 }
1443 objectGroups.Insert(group);
1444 objects.Remove(i);
1445 continue;
1446 }
1447 ++i;
1448 }
1449 }
Определения ObjectTyped.c:2
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().

Используется в FilterObstructedObjectsByGrouping().