Struct collision::Aabb2
[−]
[src]
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]
fn new(p1: Point2<S>, p2: Point2<S>) -> Aabb2<S>
[src]
Construct a new axis-aligned bounding box from two points.
fn to_corners(&self) -> [Point2<S>; 4]
[src]
Compute corners.
Trait Implementations
impl<S: Copy> Copy for Aabb2<S>
[src]
impl<S: Clone> Clone for Aabb2<S>
[src]
fn clone(&self) -> Aabb2<S>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S: PartialEq> PartialEq for Aabb2<S>
[src]
fn eq(&self, __arg_0: &Aabb2<S>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Aabb2<S>) -> bool
[src]
This method tests for !=
.
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 new(p1: Point2<S>, p2: Point2<S>) -> Aabb2<S>
[src]
Create a new AABB using two points as opposing corners.
fn min(&self) -> Point2<S>
[src]
Return a shared reference to the point nearest to (-inf, -inf).
fn max(&self) -> Point2<S>
[src]
Return a shared reference to the point nearest to (inf, inf).
fn add_margin(&self, margin: Self::Diff) -> Self
[src]
Add a margin of the given width around the AABB, returning a new AABB.
fn transform<T>(&self, transform: &T) -> Self where
T: Transform<Point2<S>>,
[src]
T: Transform<Point2<S>>,
Apply an arbitrary transform to the corners of this bounding box, return a new conservative bound. Read more
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: BaseNum> Debug 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<Line2<S>> for Aabb2<S>
[src]
impl<S: BaseNum> Union for Aabb2<S>
[src]
type Output = Aabb2<S>
Union shape created
fn union(&self, other: &Aabb2<S>) -> Aabb2<S>
[src]
Build the union shape of self and the given shape.
impl<S: BaseNum> SurfaceArea for Aabb2<S>
[src]
type Scalar = S
Result type returned from surface area computation
fn surface_area(&self) -> S
[src]
Compute surface area
impl<S: BaseFloat> Continuous<Ray2<S>> for Aabb2<S>
[src]
type Result = Point2<S>
Result returned by the intersection test
fn intersection(&self, ray: &Ray2<S>) -> Option<Point2<S>>
[src]
Intersection test
impl<S: BaseFloat> Discrete<Ray2<S>> for Aabb2<S>
[src]
fn intersects(&self, ray: &Ray2<S>) -> bool
[src]
Intersection test
impl<S: BaseFloat> Discrete<Aabb2<S>> for Aabb2<S>
[src]
fn intersects(&self, aabb: &Aabb2<S>) -> bool
[src]
Intersection test