[][src]Struct collision::Aabb2

pub struct Aabb2<S> {
    pub min: Point2<S>,
    pub max: Point2<S>,
}

A two-dimensional AABB, aka a rectangle.

Fields

min: Point2<S>

Minimum point of the AABB

max: Point2<S>

Maximum point of the AABB

Methods

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

pub fn new(p1: Point2<S>, p2: Point2<S>) -> Aabb2<S>
[src]

Construct a new axis-aligned bounding box from two points.

pub fn to_corners(&self) -> [Point2<S>; 4]
[src]

Compute corners.

Trait Implementations

impl<S: BaseFloat> Continuous<Aabb2<S>> for Ray2<S>
[src]

type Result = Point2<S>

Result returned by the intersection test

impl<S: BaseFloat> Continuous<Ray<S, Point2<S>, Vector2<S>>> for Aabb2<S>
[src]

type Result = Point2<S>

Result returned by the intersection test

impl<S: BaseFloat> Discrete<Aabb2<S>> for Ray2<S>
[src]

impl<S: BaseFloat> Discrete<Ray<S, Point2<S>, Vector2<S>>> for Aabb2<S>
[src]

impl<S: BaseFloat> Discrete<Aabb2<S>> for Aabb2<S>
[src]

impl<S: BaseNum> Contains<Point2<S>> for Aabb2<S>
[src]

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

impl<S: BaseNum> Contains<Line<S, Vector2<S>, Point2<S>>> for Aabb2<S>
[src]

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

type Scalar = S

Result type returned from surface area computation

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

type Output = Aabb2<S>

Union shape created

impl<S> ComputeBound<Aabb2<S>> for Circle<S> where
    S: BaseFloat
[src]

impl<S> ComputeBound<Aabb2<S>> for Line2<S> where
    S: BaseFloat
[src]

impl<S> ComputeBound<Aabb2<S>> for ConvexPolygon<S> where
    S: BaseFloat
[src]

impl<S> ComputeBound<Aabb2<S>> for Primitive2<S> where
    S: BaseFloat
[src]

impl<S> ComputeBound<Aabb2<S>> for Rectangle<S> where
    S: BaseFloat
[src]

impl<S> ComputeBound<Aabb2<S>> for Square<S> where
    S: BaseFloat
[src]

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

type Scalar = S

Scalar type

type Diff = Vector2<S>

Vector type

type Point = Point2<S>

Point type

fn zero() -> Self
[src]

Create a new empty AABB

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

Return the dimensions of this AABB.

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

Return the volume this AABB encloses.

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

Return the center point of this AABB.

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

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

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

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

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

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

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

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

impl<S: Copy> Copy for Aabb2<S>
[src]

impl<S: PartialEq> PartialEq<Aabb2<S>> for Aabb2<S>
[src]

impl<S: Clone> Clone for Aabb2<S>
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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

Auto Trait Implementations

impl<S> Send for Aabb2<S> where
    S: Send

impl<S> Sync for Aabb2<S> where
    S: Sync

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]