Struct splashsurf_lib::AxisAlignedBoundingBox [−][src]
Expand description
Type representing an axis aligned bounding box in arbitrary dimensions
Implementations
Constructs the smallest AABB fitting around all the given points, parallel version
Constructs an AABB with the given min and max bounding points
Constructs a degenerate AABB with zero extents centered at the given point
Constructs the smallest AABB fitting around all the given points
Tries to convert the AABB from one real type to another real type, returns None if conversion fails
Returns whether the AABB is consistent, i.e. aabb.min()[i] <= aabb.max()[i]
for all i
Returns whether the AABB is degenerate in any dimension, i.e. aabb.min()[i] == aabb.max()[i]
for any i
Returns the extents of the bounding box (vector connecting min and max point of the box)
Returns the smallest scalar extent of the AABB over all of its dimensions
Returns the largest scalar extent of the AABB over all of its dimensions
Returns the geometric centroid of the AABB (mean of the corner points)
Checks if the given point is inside of the AABB, the AABB is considered to be half-open to its max coordinate
Translates the AABB to center it at the coordinate origin (moves the centroid to the coordinate origin)
Multiplies a uniform, local scaling to the AABB (i.e. multiplying its extents as if it was centered at the origin)
Enlarges this AABB to the smallest AABB enclosing both itself and another AABB
Enlarges this AABB to the smallest AABB enclosing both itself and another point
Grows this AABB uniformly in all directions by the given scalar margin (i.e. adding the margin to min/max extents)
Returns the smallest cubical AABB with the same center that encloses this AABB
Trait Implementations
impl<R: PartialEq + Real, const D: usize> PartialEq<AxisAlignedBoundingBox<R, D>> for AxisAlignedBoundingBox<R, D>
impl<R: PartialEq + Real, const D: usize> PartialEq<AxisAlignedBoundingBox<R, D>> for AxisAlignedBoundingBox<R, D>
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<R, const D: usize> RefUnwindSafe for AxisAlignedBoundingBox<R, D> where
R: RefUnwindSafe,
impl<R, const D: usize> Send for AxisAlignedBoundingBox<R, D>
impl<R, const D: usize> Sync for AxisAlignedBoundingBox<R, D>
impl<R, const D: usize> Unpin for AxisAlignedBoundingBox<R, D> where
R: Unpin,
impl<R, const D: usize> UnwindSafe for AxisAlignedBoundingBox<R, D> where
R: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.