[−][src]Struct rust_3d::BoundingBox2D
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]
P1: Is2D,
P2: Is2D,
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]
It2D: IntoIterator<Item = &'a P>,
P: 'a + Is2D + Sized,
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]
It2D: IntoIterator<Item = P>,
P: Is2D + Sized,
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]
Self: Sized,
P: Is2D,
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]
P: Is2D,
Returns the distance to another Is2D
pub fn sqr_distance<P>(&self, other: &P) -> NonNegative where
P: Is2D,
[src]
P: Is2D,
Returns the square distance to another Is2D
Trait Implementations
impl Clone for BoundingBox2D
[src]
fn clone(&self) -> BoundingBox2D
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for BoundingBox2D
[src]
impl Default for BoundingBox2D
[src]
impl Eq for BoundingBox2D
[src]
impl From<BoundingBox2D> for Box2D
[src]
fn from(x: BoundingBox2D) -> Self
[src]
impl From<BoundingBox2D> for FilterBox2D
[src]
fn from(x: BoundingBox2D) -> Self
[src]
impl HasBoundingBox2D for BoundingBox2D
[src]
fn bounding_box(&self) -> BoundingBox2D
[src]
impl HasBoundingBox2DMaybe for BoundingBox2D
[src]
fn bounding_box_maybe(&self) -> Result<BoundingBox2D>
[src]
impl HasDistanceTo<BoundingBox2D> for BoundingBox2D
[src]
fn sqr_distance(&self, other: &BoundingBox2D) -> NonNegative
[src]
fn distance(&self, other: &T) -> NonNegative
[src]
impl Hash for BoundingBox2D
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Is2D for BoundingBox2D
[src]
fn x(&self) -> f64
[src]
fn y(&self) -> f64
[src]
fn xy(&self) -> [f64; 2]
[src]
fn dot(&self, other: &dyn Is2D) -> f64
[src]
fn cross(&self, other: &dyn Is2D) -> f64
[src]
fn abs(&self) -> NonNegative
[src]
fn rad_to(&self, other: &dyn Is2D) -> Rad
[src]
fn to_str(&self) -> String
[src]
impl IsMergeable for BoundingBox2D
[src]
impl IsMovable2D for BoundingBox2D
[src]
impl IsND for BoundingBox2D
[src]
fn n_dimensions() -> usize
[src]
fn position_nd(&self, dimension: usize) -> Result<f64>
[src]
impl IsScalable for BoundingBox2D
[src]
impl Ord for BoundingBox2D
[src]
fn cmp(&self, other: &BoundingBox2D) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<BoundingBox2D> for BoundingBox2D
[src]
fn eq(&self, other: &BoundingBox2D) -> bool
[src]
fn ne(&self, other: &BoundingBox2D) -> bool
[src]
impl PartialOrd<BoundingBox2D> for BoundingBox2D
[src]
fn partial_cmp(&self, other: &BoundingBox2D) -> Option<Ordering>
[src]
fn lt(&self, other: &BoundingBox2D) -> bool
[src]
fn le(&self, other: &BoundingBox2D) -> bool
[src]
fn gt(&self, other: &BoundingBox2D) -> bool
[src]
fn ge(&self, other: &BoundingBox2D) -> bool
[src]
impl StructuralEq for BoundingBox2D
[src]
impl StructuralPartialEq for BoundingBox2D
[src]
Auto Trait Implementations
impl RefUnwindSafe for BoundingBox2D
impl Send for BoundingBox2D
impl Sync for BoundingBox2D
impl Unpin for BoundingBox2D
impl UnwindSafe for BoundingBox2D
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,