Trait collision::Aabb [] [src]

pub trait Aabb<S: BaseNum, V: VectorSpace<Scalar=S> + ElementWise + Array<Element=S>, P: EuclideanSpace<Scalar=S, Diff=V>>: Sized {
    fn new(p1: P, p2: P) -> Self;
    fn min(&self) -> P;
    fn max(&self) -> P;
    fn contains(&self, p: P) -> bool;

    fn dim(&self) -> V { ... }
    fn volume(&self) -> S { ... }
    fn center(&self) -> P { ... }
    fn grow(&self, p: P) -> Self where P: MinMax { ... }
    fn add_v(&self, v: V) -> Self { ... }
    fn mul_s(&self, s: S) -> Self { ... }
    fn mul_v(&self, v: V) -> Self { ... }
}

Required Methods

fn new(p1: P, p2: P) -> Self

Create a new AABB using two points as opposing corners.

fn min(&self) -> P

Return a shared reference to the point nearest to (-inf, -inf).

fn max(&self) -> P

Return a shared reference to the point nearest to (inf, inf).

fn contains(&self, p: P) -> bool

Tests whether a point is cointained in the box, inclusive for min corner and exclusive for the max corner.

Provided Methods

fn dim(&self) -> V

Return the dimensions of this AABB.

fn volume(&self) -> S

Return the volume this AABB encloses.

fn center(&self) -> P

Return the center point of this AABB.

fn grow(&self, p: P) -> Self where P: MinMax

Returns a new AABB that is grown to include the given point.

fn add_v(&self, v: V) -> Self

Add a vector to every point in the AABB, returning a new AABB.

fn mul_s(&self, s: S) -> Self

Multiply every point in the AABB by a scalar, returning a new AABB.

fn mul_v(&self, v: V) -> Self

Multiply every point in the AABB by a vector, returning a new AABB.

Implementors