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

◆ SplitArrayIntoGroupsByDistance()

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

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

1551 {
1552 array<Object> group;
1553 for ( int i = 0; i < objects.Count(); )
1554 {
1555 Object obj1 = objects[i];
1556 if ( obj1 )
1557 {
1558 group = new array<Object>;
1559 group.Insert(obj1);
1560 for ( int j = objects.Count() - 1; j > i; --j )
1561 {
1562 Object obj2 = objects[j];
1563 if ( obj1 && obj2 )
1564 {
1565 vector start = obj1.GetWorldPosition();
1566 vector end = obj2.GetWorldPosition();
1567
1568 float distance = vector.DistanceSq(start, end);
1569 if ( distance < squaredDistanceDelta )
1570 {
1571 group.Insert(obj2);
1572 objects.Remove(j);
1573 }
1574 }
1575 }
1576 objectGroups.Insert(group);
1577 objects.Remove(i);
1578 continue;
1579 }
1580 ++i;
1581 }
1582 }
Определения 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().