Trait collision::prelude::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
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
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>,
T: Transform<Self::Point>,
Apply an arbitrary transform to the corners of this bounding box, return a new conservative bound.
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.