[−][src]Struct rstar::AABB

`pub struct AABB<P> where    P: Point,  { /* fields omitted */ }`

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]

`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]

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> Envelope for AABB<P> where    P: Point, `[src]

`type Point = P`

The envelope's point type.

Blanket Implementations

`impl<T> Same<T> for T`

`type Output = T`

Should always be `Self`

`impl<T> ToOwned for T where    T: Clone, `[src]

`type Owned = T`

The resulting type after obtaining ownership.

`impl<T, U> TryFrom<U> for T where    U: Into<T>, `[src]

`type Error = Infallible`

The type returned in the event of a conversion error.

`impl<T, U> TryInto<U> for T where    U: TryFrom<T>, `[src]

`type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.