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>
max: Point2<S>
Methods
impl<S: BaseNum> Aabb2<S>
[src]
fn new(p1: Point2<S>, p2: Point2<S>) -> Aabb2<S>
Construct a new axis-aligned bounding box from two points.
fn to_corners(&self) -> [Point2<S>; 4]
Compute corners.
Trait Implementations
impl<S: Encodable> Encodable for Aabb2<S>
[src]
impl<S: Decodable> Decodable for Aabb2<S>
[src]
impl<S: Copy> Copy for Aabb2<S>
[src]
impl<S: Clone> Clone for Aabb2<S>
[src]
fn clone(&self) -> Aabb2<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<S: PartialEq> PartialEq for Aabb2<S>
[src]
fn eq(&self, __arg_0: &Aabb2<S>) -> bool
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
This method tests for !=
.
impl<S: BaseNum> Aabb<S, Vector2<S>, Point2<S>> for Aabb2<S>
[src]
fn new(p1: Point2<S>, p2: Point2<S>) -> Aabb2<S>
Create a new AABB using two points as opposing corners.
fn min(&self) -> Point2<S>
Return a shared reference to the point nearest to (-inf, -inf).
fn max(&self) -> Point2<S>
Return a shared reference to the point nearest to (inf, inf).
fn contains(&self, p: Point2<S>) -> bool
Tests whether a point is cointained in the box, inclusive for min corner and exclusive for the max corner. Read more
fn dim(&self) -> V
Return the dimensions of this AABB.
fn volume(&self) -> S
Return the volume this AABB encloses.
fn center(&self) -> P
Return the center point of this AABB.
fn grow(&self, p: P) -> Self where P: MinMax
Returns a new AABB that is grown to include the given point.
fn add_v(&self, v: V) -> Self
Add a vector to every point in the AABB, returning a new AABB.
fn mul_s(&self, s: S) -> Self
Multiply every point in the AABB by a scalar, returning a new AABB.
fn mul_v(&self, v: V) -> Self
Multiply every point in the AABB by a vector, returning a new AABB.