[][src]Trait ncollide_geometry::bounding_volume::BoundingVolume

pub trait BoundingVolume<P: Point> {
    fn center(&self) -> P;
fn intersects(&self, _: &Self) -> bool;
fn contains(&self, _: &Self) -> bool;
fn merge(&mut self, _: &Self);
fn merged(&self, _: &Self) -> Self;
fn loosen(&mut self, _: P::Real);
fn loosened(&self, _: P::Real) -> Self;
fn tighten(&mut self, _: P::Real);
fn tightened(&self, _: P::Real) -> Self; }

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

fn center(&self) -> P

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

fn intersects(&self, _: &Self) -> bool

Checks if this bounding volume intersect with another one.

fn contains(&self, _: &Self) -> bool

Checks if this bounding volume contains another one.

fn merge(&mut self, _: &Self)

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

fn merged(&self, _: &Self) -> Self

Merges this bounding volume with another one.

fn loosen(&mut self, _: P::Real)

Enlarges this bounding volume.

fn loosened(&self, _: P::Real) -> Self

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

fn tighten(&mut self, _: P::Real)

Tighten this bounding volume.

fn tightened(&self, _: P::Real) -> Self

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

Loading content...

Implementors

impl<P: Point> BoundingVolume<P> for AABB<P>[src]

impl<P: Point> BoundingVolume<P> for BoundingSphere<P>[src]

Loading content...