[−][src]Trait collision::Aabb
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.
Implementors
impl<S: BaseNum> Aabb for Aabb2<S>
[src]
type Scalar = S
type Diff = Vector2<S>
type Point = Point2<S>
fn new(p1: Point2<S>, p2: Point2<S>) -> Aabb2<S>
[src]
fn min(&self) -> Point2<S>
[src]
fn max(&self) -> Point2<S>
[src]
fn add_margin(&self, margin: Self::Diff) -> Self
[src]
fn transform<T>(&self, transform: &T) -> Self where
T: Transform<Point2<S>>,
[src]
T: Transform<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 new(p1: Point3<S>, p2: Point3<S>) -> Aabb3<S>
[src]
fn min(&self) -> Point3<S>
[src]
fn max(&self) -> Point3<S>
[src]
fn add_margin(&self, margin: Self::Diff) -> Self
[src]
fn transform<T>(&self, transform: &T) -> Self where
T: Transform<Point3<S>>,
[src]
T: Transform<Point3<S>>,