mini_arcade_core.spaces.collision¶
Collision space utilities.
Submodules¶
Attributes¶
Classes¶
Circle collider specification. |
|
Simple collider specification. |
|
Line collider specification. |
|
Polygon collider specification. |
|
Rectangle collider specification. |
Functions¶
|
Generic intersection entrypoint. |
|
Convenience entity-level intersection. |
|
Axis-aligned rectangle intersection. |
Package Contents¶
- mini_arcade_core.spaces.collision.intersects(collider_a: mini_arcade_core.spaces.collision.specs.ColliderSpec | None, transform_a: mini_arcade_core.spaces.geometry.transform.Transform2D, collider_b: mini_arcade_core.spaces.collision.specs.ColliderSpec | None, transform_b: mini_arcade_core.spaces.geometry.transform.Transform2D, *, inclusive: bool = True) bool¶
Generic intersection entrypoint.
Currently implemented: - rect vs rect
Behavior: - None collider is treated as rect using transform size.
- mini_arcade_core.spaces.collision.intersects_entities(a: mini_arcade_core.engine.entities.BaseEntity, b: mini_arcade_core.engine.entities.BaseEntity, *, inclusive: bool = True) bool¶
Convenience entity-level intersection.
- mini_arcade_core.spaces.collision.rect_rect(*, ax: float, ay: float, aw: float, ah: float, bx: float, by: float, bw: float, bh: float, inclusive: bool = True) bool¶
Axis-aligned rectangle intersection.
- class mini_arcade_core.spaces.collision.CircleColliderSpec¶
Bases:
ColliderSpecCircle collider specification.
- Variables:
kind – The kind of collider (circle).
radius – The radius of the circle collider. If None, derived from min(size)/2.
- kind: Literal['circle'] = 'circle'¶
- radius: float | None = None¶
- mini_arcade_core.spaces.collision.ColliderKind¶
- class mini_arcade_core.spaces.collision.ColliderSpec¶
Simple collider specification.
- Variables:
kind – The kind of collider (rect, circle, poly, line).
- kind: ColliderKind¶
- class mini_arcade_core.spaces.collision.LineColliderSpec¶
Bases:
ColliderSpecLine collider specification.
- Variables:
kind – The kind of collider (line).
a – The start point of the line collider (local-space).
b – The end point of the line collider (local-space).
- kind: Literal['line'] = 'line'¶
- class mini_arcade_core.spaces.collision.PolyColliderSpec¶
Bases:
ColliderSpecPolygon collider specification.
- Variables:
kind – The kind of collider (poly).
points – The points of the polygon collider (local-space).
- kind: Literal['poly'] = 'poly'¶
- points: tuple[mini_arcade_core.spaces.math.vec2.Vec2, Ellipsis] = ()¶
- class mini_arcade_core.spaces.collision.RectColliderSpec¶
Bases:
ColliderSpecRectangle collider specification.
- Variables:
kind – The kind of collider (rect).
size – The size of the rectangle collider. If None, derived from transform.size.
- kind: Literal['rect'] = 'rect'¶
- size: mini_arcade_core.spaces.geometry.size.Size2D | None = None¶