pub struct BoundingBox<S>{
pub min: Point<S, U3>,
pub max: Point<S, U3>,
}Expand description
3D Bounding Box - defined by two diagonally opposing points.
Fields§
§min: Point<S, U3>X-Y-Z-Minimum corner of the box.
max: Point<S, U3>X-Y-Z-Maximum corner of the box.
Implementations§
Source§impl<S> BoundingBox<S>
impl<S> BoundingBox<S>
Sourcepub fn infinity() -> BoundingBox<S>
pub fn infinity() -> BoundingBox<S>
Returns an infinte sized box.
Sourcepub fn neg_infinity() -> BoundingBox<S>
pub fn neg_infinity() -> BoundingBox<S>
Returns a negatively infinte sized box.
Sourcepub fn new(a: &Point<S, U3>, b: &Point<S, U3>) -> BoundingBox<S>
pub fn new(a: &Point<S, U3>, b: &Point<S, U3>) -> BoundingBox<S>
Create a new Bounding Box by supplying two points.
Sourcepub fn union(&self, other: &BoundingBox<S>) -> BoundingBox<S>
pub fn union(&self, other: &BoundingBox<S>) -> BoundingBox<S>
Create a CSG Union of two Bounding Boxes.
Sourcepub fn intersection(&self, other: &BoundingBox<S>) -> BoundingBox<S>
pub fn intersection(&self, other: &BoundingBox<S>) -> BoundingBox<S>
Create a CSG Intersection of two Bounding Boxes.
Sourcepub fn transform(
&self,
mat: &Matrix<S, U4, U4, <DefaultAllocator as Allocator<S, U4, U4>>::Buffer>,
) -> BoundingBox<S>
pub fn transform( &self, mat: &Matrix<S, U4, U4, <DefaultAllocator as Allocator<S, U4, U4>>::Buffer>, ) -> BoundingBox<S>
Transform a Bounding Box - resulting in a enclosing axis aligned Bounding Box.
Sourcepub fn dilate(&mut self, d: S) -> &mut BoundingBox<S>
pub fn dilate(&mut self, d: S) -> &mut BoundingBox<S>
Dilate a Bounding Box by some amount in all directions.
Sourcepub fn insert(&mut self, o: &Point<S, U3>) -> &mut BoundingBox<S>
pub fn insert(&mut self, o: &Point<S, U3>) -> &mut BoundingBox<S>
Add a Point to a Bounding Box, e.g. expand the Bounding Box to contain that point.
Sourcepub fn dim(
&self,
) -> Matrix<S, U3, U1, <DefaultAllocator as Allocator<S, U3>>::Buffer>
pub fn dim( &self, ) -> Matrix<S, U3, U1, <DefaultAllocator as Allocator<S, U3>>::Buffer>
Return the size of the Box.
Trait Implementations§
Source§impl<T> AbsDiffEq for BoundingBox<T>
impl<T> AbsDiffEq for BoundingBox<T>
Source§fn default_epsilon() -> <BoundingBox<T> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <BoundingBox<T> as AbsDiffEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(
&self,
other: &BoundingBox<T>,
epsilon: <BoundingBox<T> as AbsDiffEq>::Epsilon,
) -> bool
fn abs_diff_eq( &self, other: &BoundingBox<T>, epsilon: <BoundingBox<T> as AbsDiffEq>::Epsilon, ) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§impl<S> Clone for BoundingBox<S>
impl<S> Clone for BoundingBox<S>
Source§fn clone(&self) -> BoundingBox<S>
fn clone(&self) -> BoundingBox<S>
Returns a duplicate 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<S> Debug for BoundingBox<S>
impl<S> Debug for BoundingBox<S>
Source§impl<S> PartialEq for BoundingBox<S>
impl<S> PartialEq for BoundingBox<S>
Source§impl<T> RelativeEq for BoundingBox<T>
impl<T> RelativeEq for BoundingBox<T>
Source§fn default_max_relative() -> <T as AbsDiffEq>::Epsilon
fn default_max_relative() -> <T as AbsDiffEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
Source§fn relative_eq(
&self,
other: &BoundingBox<T>,
epsilon: <T as AbsDiffEq>::Epsilon,
max_relative: <T as AbsDiffEq>::Epsilon,
) -> bool
fn relative_eq( &self, other: &BoundingBox<T>, epsilon: <T as AbsDiffEq>::Epsilon, max_relative: <T as AbsDiffEq>::Epsilon, ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
impl<S> StructuralPartialEq for BoundingBox<S>
Auto Trait Implementations§
impl<S> Freeze for BoundingBox<S>where
S: Freeze,
impl<S> RefUnwindSafe for BoundingBox<S>where
S: RefUnwindSafe,
impl<S> Send for BoundingBox<S>where
S: Send,
impl<S> Sync for BoundingBox<S>where
S: Sync,
impl<S> Unpin for BoundingBox<S>where
S: Unpin,
impl<S> UnwindSafe for BoundingBox<S>where
S: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.