Check all pairs in an array of shapes for interference.
Returns only pairs that have interference (distance within tolerance). For N shapes, checks N*(N-1)/2 unique pairs.
Array of shapes to test pairwise.
Distance threshold for interference. Default: 1e-6.
Array of InterferencePair entries, one per colliding pair.
const collisions = checkAllInterferences([box, sphere, cylinder]);collisions.forEach(({ i, j }) => console.log(`Shape ${i} hits shape ${j}`)); Copy
const collisions = checkAllInterferences([box, sphere, cylinder]);collisions.forEach(({ i, j }) => console.log(`Shape ${i} hits shape ${j}`));
Check all pairs in an array of shapes for interference.
Returns only pairs that have interference (distance within tolerance). For N shapes, checks N*(N-1)/2 unique pairs.