Trait parry3d_f64::bounding_volume::BoundingVolume[][src]

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

fn center(&self) -> Point<Real>[src]

Expand description

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

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

Expand description

Checks if this bounding volume intersect with another one.

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

Expand description

Checks if this bounding volume contains another one.

fn merge(&mut self, _: &Self)[src]

Expand description

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

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

Expand description

Merges this bounding volume with another one.

fn loosen(&mut self, _: Real)[src]

Expand description

Enlarges this bounding volume.

fn loosened(&self, _: Real) -> Self[src]

Expand description

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

fn tighten(&mut self, _: Real)[src]

Expand description

Tighten this bounding volume.

fn tightened(&self, _: Real) -> Self[src]

Expand description

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

Implementors

impl BoundingVolume for AABB[src]

fn center(&self) -> Point<Real>[src]

fn intersects(&self, other: &AABB) -> bool[src]

fn contains(&self, other: &AABB) -> bool[src]

fn merge(&mut self, other: &AABB)[src]

fn merged(&self, other: &AABB) -> AABB[src]

fn loosen(&mut self, amount: Real)[src]

fn loosened(&self, amount: Real) -> AABB[src]

fn tighten(&mut self, amount: Real)[src]

fn tightened(&self, amount: Real) -> AABB[src]

impl BoundingVolume for BoundingSphere[src]

fn center(&self) -> Point<Real>[src]

fn intersects(&self, other: &BoundingSphere) -> bool[src]

fn contains(&self, other: &BoundingSphere) -> bool[src]

fn merge(&mut self, other: &BoundingSphere)[src]

fn merged(&self, other: &BoundingSphere) -> BoundingSphere[src]

fn loosen(&mut self, amount: Real)[src]

fn loosened(&self, amount: Real) -> BoundingSphere[src]

fn tighten(&mut self, amount: Real)[src]

fn tightened(&self, amount: Real) -> BoundingSphere[src]