[−][src]Struct rstar::AABB
An n-dimensional axis aligned bounding box (AABB).
An object's AABB is the smallest box totally encompassing an object while being aligned to the current coordinate system. Although these structures are commonly called bounding boxes, they exist in any dimension.
Note that AABBs cannot be inserted into r-trees. Use the Rectangle struct for this purpose.
Type arguments
P
: The struct is generic over which point type is used. Using an n-dimensional point
type will result in an n-dimensional bounding box.
Implementations
impl<P> AABB<P> where
P: Point,
[src]
P: Point,
pub fn from_point(p: P) -> Self
[src]
Returns the AABB encompassing a single point.
pub fn lower(&self) -> P
[src]
Returns the AABB's lower corner.
This is the point contained within the AABB with the smallest coordinate value in each dimension.
pub fn upper(&self) -> P
[src]
Returns the AABB's upper corner.
This is the point contained within the AABB with the largest coordinate value in each dimension.
pub fn from_corners(p1: P, p2: P) -> Self
[src]
Creates a new AABB encompassing two points.
pub fn from_points<'a, I>(i: I) -> Self where
I: IntoIterator<Item = &'a P> + 'a,
P: 'a,
[src]
I: IntoIterator<Item = &'a P> + 'a,
P: 'a,
Creates a new AABB encompassing a collection of points.
pub fn min_point(&self, point: &P) -> P
[src]
Returns the point within this AABB closest to a given point.
If point
is contained within the AABB, point
will be returned.
pub fn distance_2(&self, point: &P) -> P::Scalar
[src]
Returns the squared distance to the AABB's min_point.
Trait Implementations
impl<P: Clone> Clone for AABB<P> where
P: Point,
[src]
P: Point,
impl<P: Copy> Copy for AABB<P> where
P: Point,
[src]
P: Point,
impl<P: Debug> Debug for AABB<P> where
P: Point,
[src]
P: Point,
impl<P> Envelope for AABB<P> where
P: Point,
[src]
P: Point,
type Point = P
The envelope's point type.
fn new_empty() -> Self
[src]
fn contains_point(&self, point: &P) -> bool
[src]
fn contains_envelope(&self, other: &Self) -> bool
[src]
fn merge(&mut self, other: &Self)
[src]
fn merged(&self, other: &Self) -> Self
[src]
fn intersects(&self, other: &Self) -> bool
[src]
fn area(&self) -> P::Scalar
[src]
fn distance_2(&self, point: &P) -> P::Scalar
[src]
fn min_max_dist_2(&self, point: &P) -> <P as Point>::Scalar
[src]
fn center(&self) -> Self::Point
[src]
fn intersection_area(&self, other: &Self) -> <Self::Point as Point>::Scalar
[src]
fn perimeter_value(&self) -> P::Scalar
[src]
fn sort_envelopes<T: RTreeObject<Envelope = Self>>(
axis: usize,
envelopes: &mut [T]
)
[src]
axis: usize,
envelopes: &mut [T]
)
fn partition_envelopes<T: RTreeObject<Envelope = Self>>(
axis: usize,
envelopes: &mut [T],
selection_size: usize
)
[src]
axis: usize,
envelopes: &mut [T],
selection_size: usize
)
impl<P: Eq> Eq for AABB<P> where
P: Point,
[src]
P: Point,
impl<P> From<AABB<P>> for Rectangle<P> where
P: Point,
[src]
P: Point,
impl<P: Ord> Ord for AABB<P> where
P: Point,
[src]
P: Point,
fn cmp(&self, other: &AABB<P>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<P: PartialEq> PartialEq<AABB<P>> for AABB<P> where
P: Point,
[src]
P: Point,
impl<P: PartialOrd> PartialOrd<AABB<P>> for AABB<P> where
P: Point,
[src]
P: Point,
fn partial_cmp(&self, other: &AABB<P>) -> Option<Ordering>
[src]
fn lt(&self, other: &AABB<P>) -> bool
[src]
fn le(&self, other: &AABB<P>) -> bool
[src]
fn gt(&self, other: &AABB<P>) -> bool
[src]
fn ge(&self, other: &AABB<P>) -> bool
[src]
impl<P> StructuralEq for AABB<P> where
P: Point,
[src]
P: Point,
impl<P> StructuralPartialEq for AABB<P> where
P: Point,
[src]
P: Point,
Auto Trait Implementations
impl<P> RefUnwindSafe for AABB<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
impl<P> Send for AABB<P> where
P: Send,
P: Send,
impl<P> Sync for AABB<P> where
P: Sync,
P: Sync,
impl<P> Unpin for AABB<P> where
P: Unpin,
P: Unpin,
impl<P> UnwindSafe for AABB<P> where
P: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,