pub trait BoundingVolume<N: RealField + Copy>: Debug {
    fn center(&self) -> Point<N>;
fn intersects(&self, _: &Self) -> bool;
fn contains(&self, _: &Self) -> bool;
fn merge(&mut self, _: &Self);
fn merged(&self, _: &Self) -> Self;
fn loosen(&mut self, _: N);
fn loosened(&self, _: N) -> Self;
fn tighten(&mut self, _: N);
fn tightened(&self, _: N) -> Self; }
Expand description

Trait of bounding volumes.

Bounding volumes are coarse approximations of shapes. It usually have constant time intersection, inclusion test. Two bounding volume must also be mergeable into a bigger bounding volume.

Required methods

Returns a point inside of this bounding volume. This is ideally its center.

Checks if this bounding volume intersect with another one.

Checks if this bounding volume contains another one.

Merges this bounding volume with another one. The merge is done in-place.

Merges this bounding volume with another one.

Enlarges this bounding volume.

Creates a new, enlarged version, of this bounding volume.

Tighten this bounding volume.

Creates a new, tightened version, of this bounding volume.

Implementors