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

◆ SplitArrayIntoGroupsByDistance()

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

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

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

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

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