Trait collision::Aabb [] [src]

pub trait Aabb: Sized {
    type Scalar: BaseNum;
    type Diff: VectorSpace<Scalar = Self::Scalar> + ElementWise + Array<Element = Self::Scalar>;
    type Point: EuclideanSpace<Scalar = Self::Scalar, Diff = Self::Diff> + MinMax;
    fn new(p1: Self::Point, p2: Self::Point) -> Self;
fn min(&self) -> Self::Point;
fn max(&self) -> Self::Point;
fn add_margin(&self, margin: Self::Diff) -> Self;
fn transform<T>(&self, transform: &T) -> Self
    where
        T: Transform<Self::Point>
; fn zero() -> Self { ... }
fn dim(&self) -> Self::Diff { ... }
fn volume(&self) -> Self::Scalar { ... }
fn center(&self) -> Self::Point { ... }
fn grow(&self, p: Self::Point) -> Self { ... }
fn add_v(&self, v: Self::Diff) -> Self { ... }
fn mul_s(&self, s: Self::Scalar) -> Self { ... }
fn mul_v(&self, v: Self::Diff) -> Self { ... } }

Base trait describing an axis aligned bounding box.

Associated Types

Scalar type

Vector type

Point type

Required Methods

Create a new AABB using two points as opposing corners.

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

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

Add a margin of the given width around the AABB, returning a new AABB.

Apply an arbitrary transform to the corners of this bounding box, return a new conservative bound.

Provided Methods

Create a new empty AABB

Return the dimensions of this AABB.

Return the volume this AABB encloses.

Return the center point of this AABB.

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

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

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

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

Implementors