Enum landmass::BoundingBox
source · pub enum BoundingBox {
Empty,
Box {
min: Vec3,
max: Vec3,
},
}
Expand description
A bounding box.
Variants§
Implementations§
source§impl BoundingBox
impl BoundingBox
sourcepub fn new_box(min: Vec3, max: Vec3) -> Self
pub fn new_box(min: Vec3, max: Vec3) -> Self
Creates a box already with some data in it. min
and max
must already
be valid - this is unchecked.
sourcepub fn size(&self) -> Vec3
pub fn size(&self) -> Vec3
Computes the size of the bounding box. Returns 0 if the bounds are empty.
sourcepub fn expand_to_bounds(&self, other: &Self) -> Self
pub fn expand_to_bounds(&self, other: &Self) -> Self
Expands the bounding box to contain the other
.
sourcepub fn expand_to_point(&self, point: Vec3) -> Self
pub fn expand_to_point(&self, point: Vec3) -> Self
Expands the bounding box to contain point
. If the box was empty, it will
now hold only the point
.
sourcepub fn expand_by_size(&self, size: Vec3) -> BoundingBox
pub fn expand_by_size(&self, size: Vec3) -> BoundingBox
Expands the bounding box by size
. An empty bounding box will still be
empty after this.
sourcepub fn contains_point(&self, point: Vec3) -> bool
pub fn contains_point(&self, point: Vec3) -> bool
Determines if point
is in self
.
sourcepub fn contains_bounds(&self, other: &Self) -> bool
pub fn contains_bounds(&self, other: &Self) -> bool
Determines if other
is fully contained by self
.
sourcepub fn intersects_bounds(&self, other: &Self) -> bool
pub fn intersects_bounds(&self, other: &Self) -> bool
Detemrines if other
intersects self
at all.
Trait Implementations§
source§impl Clone for BoundingBox
impl Clone for BoundingBox
source§fn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BoundingBox
impl Debug for BoundingBox
source§impl PartialEq for BoundingBox
impl PartialEq for BoundingBox
source§fn eq(&self, other: &BoundingBox) -> bool
fn eq(&self, other: &BoundingBox) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for BoundingBox
impl StructuralPartialEq for BoundingBox
Auto Trait Implementations§
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin for BoundingBox
impl UnwindSafe for BoundingBox
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