Struct cgmath::Aabb2 [] [src]

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

A two-dimensional AABB, aka a rectangle.

Fields

min
max

Methods

impl<S: BaseNum> Aabb2<S>

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: BaseNum> Aabb<S, Vector2<S>, Point2<S>> for Aabb2<S>

fn new(p1: Point2<S>, p2: Point2<S>) -> Aabb2<S>

fn min<'a>(&'a self) -> &'a Point2<S>

fn max<'a>(&'a self) -> &'a Point2<S>

fn contains(&self, p: &Point2<S>) -> bool

fn dim(&self) -> V

fn volume(&self) -> S

fn center(&self) -> P

fn grow(&self, p: &P) -> Self

fn add_v(&self, v: &V) -> Self

fn mul_s(&self, s: S) -> Self

fn mul_v(&self, v: &V) -> Self

impl<S: BaseNum> Debug for Aabb2<S>

fn fmt(&self, f: &mut Formatter) -> Result

Derived Implementations

impl<S: Decodable> Decodable for Aabb2<S>

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Aabb2<S>, __D::Error>

impl<S: Encodable> Encodable for Aabb2<S>

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl<S: PartialEq> PartialEq for Aabb2<S>

fn eq(&self, __arg_0: &Aabb2<S>) -> bool

fn ne(&self, __arg_0: &Aabb2<S>) -> bool

impl<S: Clone> Clone for Aabb2<S>

fn clone(&self) -> Aabb2<S>

fn clone_from(&mut self, source: &Self)

impl<S: Copy> Copy for Aabb2<S>