intersect method

  1. @override
List<Vector2> intersect(
  1. PathComponent pathA,
  2. PathComponent pathB, {
  3. Rect? overlappingRect,
})
override

Returns the intersection points of the edges of all the polygons of pathA and pathB.

Implementation

@override
List<Vector2> intersect(
  PathComponent pathA,
  PathComponent pathB, {
  Rect? overlappingRect,
}) {
  final intersectionPoints = _edgeIntersections(
    pathA.possibleIntersectionVertices(overlappingRect),
    pathB.possibleIntersectionVertices(overlappingRect),
  );
  if (intersectionPoints.isEmpty) {
    return _enclosedCenter(pathA, _vertexOf(pathA), pathB, _vertexOf(pathB));
  }
  return intersectionPoints;
}