intersections function
List<Vector2>
intersections(
- ShapeComponent shapeA,
- ShapeComponent shapeB, {
- Rect? overlappingRect,
Implementation
List<Vector2> intersections(
ShapeComponent shapeA,
ShapeComponent shapeB, {
Rect? overlappingRect,
}) {
final intersectionSystem = _intersectionSystems.firstWhere(
(system) => system.supportsShapes(shapeA, shapeB),
orElse: () {
throw 'Unsupported intersection detected between: '
'${shapeA.runtimeType} and ${shapeB.runtimeType}';
},
);
return intersectionSystem.unorderedIntersect(
shapeA,
shapeB,
overlappingRect: overlappingRect,
);
}