simvx.core.math.aabb¶
AABB — 3D axis-aligned bounding box.
Module Contents¶
Classes¶
3D axis-aligned bounding box. |
API¶
- class simvx.core.math.aabb.AABB(x=0.0, y=0.0, z=0.0, sx=0.0, sy=0.0, sz=0.0)[source]¶
3D axis-aligned bounding box.
Initialization
- __slots__¶
(‘x’, ‘y’, ‘z’, ‘sx’, ‘sy’, ‘sz’)
- property position: tuple[float, float, float]¶
- property size: tuple[float, float, float]¶
- property end: tuple[float, float, float]¶
- property volume: float¶
- property center: tuple[float, float, float]¶
- contains_point(x: float, y: float, z: float) bool[source]¶
Return True if (x, y, z) lies inside (or on the boundary of) this AABB.
- intersects(other: simvx.core.math.aabb.AABB) bool[source]¶
Return True if this AABB overlaps with other.
- intersection(other: simvx.core.math.aabb.AABB) simvx.core.math.aabb.AABB[source]¶
Return the overlapping volume, or a zero AABB if none.
- merge(other: simvx.core.math.aabb.AABB) simvx.core.math.aabb.AABB[source]¶
Return the smallest AABB enclosing both AABBs (union).
- expand(point) simvx.core.math.aabb.AABB[source]¶
Return an AABB expanded to include the given point.
- grow(amount: float) simvx.core.math.aabb.AABB[source]¶
Return an AABB grown by amount on each side.