[][src]Struct rust_3d::BoundingBox2D

pub struct BoundingBox2D { /* fields omitted */ }

BoundingBox2D, an axis aligned bounding box within 2D space

Implementations

impl BoundingBox2D[src]

pub fn new<P1, P2>(min: &P1, max: &P2) -> Result<BoundingBox2D> where
    P1: Is2D,
    P2: Is2D
[src]

Creates a new BoundingBox2D with the given min and max positions

pub fn from_iterator<'a, It2D, P>(source: It2D) -> Result<BoundingBox2D> where
    It2D: IntoIterator<Item = &'a P>,
    P: 'a + Is2D + Sized
[src]

Creates a new BoundingBox2D which contains all the given positions

pub fn from_into_iterator<It2D, P>(source: It2D) -> Result<BoundingBox2D> where
    It2D: IntoIterator<Item = P>,
    P: Is2D + Sized
[src]

Creates a new BoundingBox2D which contains all the given positions

pub fn min_p(&self) -> Point2D[src]

Returns the minimum position of the bounding box

pub fn max_p(&self) -> Point2D[src]

Returns the maximum position of the bounding box

pub fn size_x(&self) -> Positive[src]

Returns the size the bounding box within the x-dimension

pub fn size_y(&self) -> Positive[src]

Returns the size the bounding box within the y-dimension

pub fn sizes(&self) -> [Positive; 2][src]

Returns the sizes of the bounding box

pub fn center_bb(&self) -> Point2D[src]

Returns the center of the bounding box

pub fn is_inside(&self, other: &BoundingBox2D) -> bool[src]

Tests whether this bounding box is within the other

pub fn contains<P>(&self, other: &P) -> bool where
    Self: Sized,
    P: Is2D
[src]

Tests whether this bounding box contains a position

pub fn has_inside(&self, other: &BoundingBox2D) -> bool[src]

Tests whether this bounding box contains the other

pub fn collides_with(&self, other: &BoundingBox2D) -> bool[src]

Tests whether this bounding box and the other overlap in any way

pub fn crossing_x_value(&self, x: f64) -> bool[src]

Tests whether this bounding box crosses a certain x value

pub fn crossing_y_value(&self, y: f64) -> bool[src]

Tests whether this bounding box crosses a certain y value

pub fn corners(&self) -> [Point2D; 4][src]

Returns the corner points of the bounding box

pub fn distance<P>(&self, other: &P) -> NonNegative where
    P: Is2D
[src]

Returns the distance to another Is2D

pub fn sqr_distance<P>(&self, other: &P) -> NonNegative where
    P: Is2D
[src]

Returns the square distance to another Is2D

Trait Implementations

impl Clone for BoundingBox2D[src]

impl Debug for BoundingBox2D[src]

impl Default for BoundingBox2D[src]

impl Eq for BoundingBox2D[src]

impl From<BoundingBox2D> for Box2D[src]

impl From<BoundingBox2D> for FilterBox2D[src]

impl HasBoundingBox2D for BoundingBox2D[src]

impl HasBoundingBox2DMaybe for BoundingBox2D[src]

impl HasDistanceTo<BoundingBox2D> for BoundingBox2D[src]

impl Hash for BoundingBox2D[src]

impl Is2D for BoundingBox2D[src]

impl IsMergeable for BoundingBox2D[src]

impl IsMovable2D for BoundingBox2D[src]

impl IsND for BoundingBox2D[src]

impl IsScalable for BoundingBox2D[src]

impl Ord for BoundingBox2D[src]

impl PartialEq<BoundingBox2D> for BoundingBox2D[src]

impl PartialOrd<BoundingBox2D> for BoundingBox2D[src]

impl StructuralEq for BoundingBox2D[src]

impl StructuralPartialEq for BoundingBox2D[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.