pub struct Aabb2 {
pub min: Point2,
pub max: Point2,
}Expand description
Axis-aligned two-dimensional bounding box.
The XY-plane counterpart of Aabb, with the same empty-absorbs-first
behaviour so a fold over points needs no special case for the first one.
Fields§
§min: Point2Minimum corner.
max: Point2Maximum corner.
Implementations§
Source§impl Aabb2
impl Aabb2
Sourcepub const fn empty() -> Self
pub const fn empty() -> Self
An empty box that absorbs the first extended point.
Inverted on purpose: min starts at positive infinity and max at
negative infinity, so the first extend overwrites both rather than
leaving a spurious box around the origin.
Sourcepub const fn from_point(point: Point2) -> Self
pub const fn from_point(point: Point2) -> Self
Construct a non-empty box containing exactly one point.
Sourcepub fn intersects(&self, other: &Self) -> bool
pub fn intersects(&self, other: &Self) -> bool
Whether the boxes overlap. Touching counts as overlap.
Trait Implementations§
impl Copy for Aabb2
impl StructuralPartialEq for Aabb2
Auto Trait Implementations§
impl Freeze for Aabb2
impl RefUnwindSafe for Aabb2
impl Send for Aabb2
impl Sync for Aabb2
impl Unpin for Aabb2
impl UnwindSafe for Aabb2
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more