[][src]Trait collision::Aabb

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

type Scalar: BaseNum

Scalar type

type Diff: VectorSpace<Scalar = Self::Scalar> + ElementWise + Array<Element = Self::Scalar>

Vector type

type Point: EuclideanSpace<Scalar = Self::Scalar, Diff = Self::Diff> + MinMax

Point type

Loading content...

Required methods

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

Create a new AABB using two points as opposing corners.

fn min(&self) -> Self::Point

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

fn max(&self) -> Self::Point

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

fn add_margin(&self, margin: Self::Diff) -> Self

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

fn transform<T>(&self, transform: &T) -> Self where
    T: Transform<Self::Point>, 

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

Loading content...

Provided methods

fn zero() -> Self

Create a new empty AABB

fn dim(&self) -> Self::Diff

Return the dimensions of this AABB.

fn volume(&self) -> Self::Scalar

Return the volume this AABB encloses.

fn center(&self) -> Self::Point

Return the center point of this AABB.

fn grow(&self, p: Self::Point) -> Self

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

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

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

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

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

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

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

Loading content...

Implementors

impl<S: BaseNum> Aabb for Aabb2<S>
[src]

type Scalar = S

type Diff = Vector2<S>

type Point = Point2<S>

fn zero() -> Self
[src]

fn dim(&self) -> Self::Diff
[src]

fn volume(&self) -> Self::Scalar
[src]

fn center(&self) -> Self::Point
[src]

fn grow(&self, p: Self::Point) -> Self
[src]

fn add_v(&self, v: Self::Diff) -> Self
[src]

fn mul_s(&self, s: Self::Scalar) -> Self
[src]

fn mul_v(&self, v: Self::Diff) -> Self
[src]

impl<S: BaseNum> Aabb for Aabb3<S>
[src]

type Scalar = S

type Diff = Vector3<S>

type Point = Point3<S>

fn zero() -> Self
[src]

fn dim(&self) -> Self::Diff
[src]

fn volume(&self) -> Self::Scalar
[src]

fn center(&self) -> Self::Point
[src]

fn grow(&self, p: Self::Point) -> Self
[src]

fn add_v(&self, v: Self::Diff) -> Self
[src]

fn mul_s(&self, s: Self::Scalar) -> Self
[src]

fn mul_v(&self, v: Self::Diff) -> Self
[src]

Loading content...