Trait cgmath::Aabb [] [src]

pub trait Aabb<S: BaseNum, V: Vector<S>, P: Point<S, V>>: Sized {
    fn new(p1: P, p2: P) -> Self;
    fn min<'a>(&'a self) -> &'a P;
    fn max<'a>(&'a self) -> &'a 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 { ... }
    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<'a>(&'a self) -> &'a P

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

fn max<'a>(&'a self) -> &'a 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

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