Struct rstar::AABB [−][src]
pub struct AABB<P> where
P: Point, { /* fields omitted */ }
Expand description
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
Returns the AABB encompassing a single point.
Returns the AABB’s lower corner.
This is the point contained within the AABB with the smallest coordinate value in each dimension.
Returns the AABB’s upper corner.
This is the point contained within the AABB with the largest coordinate value in each dimension.
Creates a new AABB encompassing two points.
Creates a new AABB encompassing a collection of points.
Returns the point within this AABB closest to a given point.
If point
is contained within the AABB, point
will be returned.
Returns the squared distance to the AABB’s min_point.
Trait Implementations
type Point = P
type Point = P
The envelope’s point type.
Returns true if a point is contained within this envelope.
Returns true if another envelope is fully contained within self
.
Returns the minimal envelope containing self
and another envelope.
Sets self
to the intersection of self
and another envelope.
Returns the euclidean distance to the envelope’s border.
Returns the squared min-max distance, a concept that helps to find nearest neighbors efficiently. Read more
Returns the area of the intersection of self
and another envelope.
Returns a value proportional to the envelope’s perimeter.
Sorts a given set of objects with envelopes along one of their axis.
fn partition_envelopes<T: RTreeObject<Envelope = Self>>(
axis: usize,
envelopes: &mut [T],
selection_size: usize
)
fn partition_envelopes<T: RTreeObject<Envelope = Self>>(
axis: usize,
envelopes: &mut [T],
selection_size: usize
)
Partitions objects with an envelopes along a certain axis. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<P> RefUnwindSafe for AABB<P> where
P: RefUnwindSafe,
impl<P> UnwindSafe for AABB<P> where
P: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more