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

◆ SplitArrayIntoGroupsByDistance()

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

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

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