- class CollisionSet(shapes: list[Shape], position: Vector = (0, 0))
An abstraction layer that allows for testing intersections between arbitrary types and numbers of shapes. Used primarily for issuing warnings when Entity objects are placed such that they overlap each other in ways that would not be permitted in game. Almost all entities use a single AABB, but this class allows for more handling more complex collisions for rail entities and others.
- get_bounding_box() AABB
Gets the minimum-bounding AABB for this
AABBwith the maximal dimensions for this
CollisionSethas no shapes.
- overlaps(other: CollisionSet) bool
Checks to see if any of this
shapesintersect any part of
other – The other
CollisionSetto test against.
Trueif they overlap,
Falseif they do not.
- rotate(amt: int) CollisionSet
amtis in increments of 45 degrees. Contsructs a new collision set with the rotated shapes.
amt – The amount to rotate as multiples of 45 degrees.
CollisionSetwith the rotated contents.