intersections function

Set<Vector2> intersections(
  1. ShapeComponent shapeA,
  2. ShapeComponent shapeB
)

Implementation

Set<Vector2> intersections(ShapeComponent shapeA, ShapeComponent shapeB) {
  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);
}