pub struct BBox2D {
pub min_x: f64,
pub min_y: f64,
pub max_x: f64,
pub max_y: f64,
}Expand description
A 2-dimensional axis-aligned bounding box.
Fields§
§min_x: f64Minimum X.
min_y: f64Minimum Y.
max_x: f64Maximum X.
max_y: f64Maximum Y.
Implementations§
Source§impl BBox2D
impl BBox2D
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Returns true if the bounding box is geometrically valid (min ≤ max).
Sourcepub fn contains_point(&self, p: Point2D) -> bool
pub fn contains_point(&self, p: Point2D) -> bool
Returns true if the point lies inside (or on the boundary of) this box.
Sourcepub fn intersects(&self, other: &BBox2D) -> bool
pub fn intersects(&self, other: &BBox2D) -> bool
Returns true if this bounding box overlaps with another.
Trait Implementations§
impl Copy for BBox2D
impl StructuralPartialEq for BBox2D
Auto Trait Implementations§
impl Freeze for BBox2D
impl RefUnwindSafe for BBox2D
impl Send for BBox2D
impl Sync for BBox2D
impl Unpin for BBox2D
impl UnsafeUnpin for BBox2D
impl UnwindSafe for BBox2D
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