verse.utils.utils.are_polygons_intersecting
- verse.utils.utils.are_polygons_intersecting(a: ndarray | Sequence[float], b: ndarray | Sequence[float], displacement_a: ndarray | Sequence[float], displacement_b: ndarray | Sequence[float]) Tuple[bool, bool, ndarray | None]
Checks if the two polygons are intersecting.
See https://www.codeproject.com/Articles/15573/2D-Polygon-Collision-Detection
- Parameters:
a – polygon A, as a list of [x, y] points
b – polygon B, as a list of [x, y] points
displacement_a – velocity of the polygon A
displacement_b – velocity of the polygon B
- Returns:
are intersecting, will intersect, translation vector