312 Index dominantCellIndex = zoneType1 > zoneType2 ? cellIndex1 : cellIndex2;
314 Vec3i zoneId1 = cell.id[dominantCellIndex];
317 zoneId1[0] >>= tierAccumulation;
318 zoneId1[1] >>= tierAccumulation;
319 zoneId1[2] >>= tierAccumulation;
321 zoneId2[0] >>= tierAccumulation;
322 zoneId2[1] >>= tierAccumulation;
323 zoneId2[2] >>= tierAccumulation;
325 Vec3i boundaryId = zoneId1 + zoneId2;
333 UInt cornerShift =
UInt(1) << (tierAccumulation-1);
334 Vec3i cornerId1 = cell.id[cellIndex1] + cornerShift;
335 Vec3i cornerId2 = cell.id[cellIndex2] + cornerShift;
337 cornerId1[0] >>= tierAccumulation;
338 cornerId1[1] >>= tierAccumulation;
339 cornerId1[2] >>= tierAccumulation;
341 cornerId2[0] >>= tierAccumulation;
342 cornerId2[1] >>= tierAccumulation;
343 cornerId2[2] >>= tierAccumulation;
345 if (cornerId1 == cornerId2)
348 return cornerId1 + cornerId2 - 1;
358 Vec3i offset = cell.id[cellIndex1] - cell.id[cellIndex2];
360 if ((offset[0] & offset[1] & offset[2] & 0x1) && zoneType1 ==
ZONE_EDGE && zoneType2 ==
ZONE_EDGE && cell.zoneType[cellIndex1] != cell.zoneType[cellIndex2] * -1)
362 std::cout <<
"detected special edge/edge diagonal, cell1: " << cell.id[cellIndex1] <<
", cell2: " << cell.id[cellIndex2] << std::endl;
367 Vec3i cornerId1 = cell.id[cellIndex1] + dir1 + dir2;
368 Vec3i cornerId2 = cell.id[cellIndex2] + dir1 + dir2;
373 cornerId1[0] >>= tierAccumulation;
374 cornerId1[1] >>= tierAccumulation;
375 cornerId1[2] >>= tierAccumulation;
377 cornerId2[0] >>= tierAccumulation;
378 cornerId2[1] >>= tierAccumulation;
379 cornerId2[2] >>= tierAccumulation;
381 return cornerId1 + cornerId2;
389 return cell.id[parentIndex1] + cell.id[parentIndex2];
AGXPHYSICS_EXPORT Vec3i calculateBoundaryZoneId(CellData &cell, Index cellIndex1, Index cellIndex2, UInt tierAccumulation)
Corners and edges are extended to make all edges independent of each other, and the same for all face...