intersections method

  1. @override
List<Vector2> intersections(
  1. Hitbox<Hitbox> other
)
override

Where this ShapeComponent has intersection points with another shape

Implementation

@override
List<Vector2> intersections(Hitbox other) {
  assert(
    other is ShapeComponent,
    'The intersection can only be performed between shapes',
  );
  final overlappingRect = aabb
      .intersectionWithAabb2((other as ShapeHitbox).aabb)
      .inflate(_overlapEpsilon);
  return intersection_system.intersections(
    this,
    other,
    overlappingRect: overlappingRect,
  );
}