pub struct BBox<C = f64, const D: usize = 2> {
pub min: Point<C, D>,
pub max: Point<C, D>,
}Expand description
Axis-aligned bounding box in D dimensions.
Fields§
§min: Point<C, D>§max: Point<C, D>Implementations§
Source§impl<C: CoordType, const D: usize> BBox<C, D>
impl<C: CoordType, const D: usize> BBox<C, D>
Sourcepub fn new(min: Point<C, D>, max: Point<C, D>) -> Self
pub fn new(min: Point<C, D>, max: Point<C, D>) -> Self
Construct a bounding box from min and max points.
Sourcepub fn contains_point(&self, point: &Point<C, D>) -> bool
pub fn contains_point(&self, point: &Point<C, D>) -> bool
Returns true iff point lies within this box on all D axes (inclusive).
Sourcepub fn intersects(&self, other: &BBox<C, D>) -> bool
pub fn intersects(&self, other: &BBox<C, D>) -> bool
Returns true iff this bounding box overlaps other on all D axes.
Trait Implementations§
impl<C: Copy, const D: usize> Copy for BBox<C, D>
impl<C, const D: usize> StructuralPartialEq for BBox<C, D>
Auto Trait Implementations§
impl<C, const D: usize> Freeze for BBox<C, D>where
C: Freeze,
impl<C, const D: usize> RefUnwindSafe for BBox<C, D>where
C: RefUnwindSafe,
impl<C, const D: usize> Send for BBox<C, D>where
C: Send,
impl<C, const D: usize> Sync for BBox<C, D>where
C: Sync,
impl<C, const D: usize> Unpin for BBox<C, D>where
C: Unpin,
impl<C, const D: usize> UnsafeUnpin for BBox<C, D>where
C: UnsafeUnpin,
impl<C, const D: usize> UnwindSafe for BBox<C, D>where
C: UnwindSafe,
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