pub struct AABB3D<S> {
pub min_x: S,
pub min_y: S,
pub min_z: S,
pub max_x: S,
pub max_y: S,
pub max_z: S,
}Expand description
Axis-aligned bounding box in 3D.
Fields§
§min_x: SMinimum x coordinate.
min_y: SMinimum y coordinate.
min_z: SMinimum z coordinate.
max_x: SMaximum x coordinate.
max_y: SMaximum y coordinate.
max_z: SMaximum z coordinate.
Implementations§
Source§impl<S: RealField + Copy> AABB3D<S>
impl<S: RealField + Copy> AABB3D<S>
Sourcepub fn new(min_x: S, min_y: S, min_z: S, max_x: S, max_y: S, max_z: S) -> Self
pub fn new(min_x: S, min_y: S, min_z: S, max_x: S, max_y: S, max_z: S) -> Self
Creates a new AABB from min/max coordinates.
Sourcepub fn from_points(points: &[(S, S, S)]) -> Option<Self>
pub fn from_points(points: &[(S, S, S)]) -> Option<Self>
Creates an AABB from a set of points.
Sourcepub fn contains_point(&self, x: S, y: S, z: S) -> bool
pub fn contains_point(&self, x: S, y: S, z: S) -> bool
Checks if this AABB contains a point.
Sourcepub fn intersects(&self, other: &Self) -> bool
pub fn intersects(&self, other: &Self) -> bool
Checks if this AABB intersects another AABB.
Sourcepub fn intersection(&self, other: &Self) -> Option<Self>
pub fn intersection(&self, other: &Self) -> Option<Self>
Returns the intersection of two AABBs, if any.
Trait Implementations§
impl<S: Copy> Copy for AABB3D<S>
impl<S> StructuralPartialEq for AABB3D<S>
Auto Trait Implementations§
impl<S> Freeze for AABB3D<S>where
S: Freeze,
impl<S> RefUnwindSafe for AABB3D<S>where
S: RefUnwindSafe,
impl<S> Send for AABB3D<S>where
S: Send,
impl<S> Sync for AABB3D<S>where
S: Sync,
impl<S> Unpin for AABB3D<S>where
S: Unpin,
impl<S> UnwindSafe for AABB3D<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.