pub struct BoundingBox3D { /* private fields */ }
Expand description
BoundingBox3D, an axis aligned bounding box within 3D space
Implementations§
Source§impl BoundingBox3D
impl BoundingBox3D
Sourcepub fn new<P1, P2>(min: &P1, max: &P2) -> Result<BoundingBox3D>
pub fn new<P1, P2>(min: &P1, max: &P2) -> Result<BoundingBox3D>
Creates a new BoundingBox3D with the given min and max positions
Sourcepub fn from_iterator<'a, It3D, P>(source: It3D) -> Result<BoundingBox3D>
pub fn from_iterator<'a, It3D, P>(source: It3D) -> Result<BoundingBox3D>
Creates a new BoundingBox3D which contains all the given positions
Sourcepub fn from_into_iterator<It3D, P>(source: It3D) -> Result<BoundingBox3D>
pub fn from_into_iterator<It3D, P>(source: It3D) -> Result<BoundingBox3D>
Creates a new BoundingBox3D which contains all the given positions
Sourcepub fn is_inside(&self, other: &BoundingBox3D) -> bool
pub fn is_inside(&self, other: &BoundingBox3D) -> bool
Tests whether this bounding box is within the other
Sourcepub fn contains<P>(&self, other: &P) -> bool
pub fn contains<P>(&self, other: &P) -> bool
Tests whether this bounding box contains a position
Sourcepub fn has_inside(&self, other: &BoundingBox3D) -> bool
pub fn has_inside(&self, other: &BoundingBox3D) -> bool
Tests whether this bounding box contains the other
Sourcepub fn collides_with(&self, other: &BoundingBox3D) -> bool
pub fn collides_with(&self, other: &BoundingBox3D) -> bool
Tests whether this bounding box and the other overlap in any way
Sourcepub fn crossing_x_value(&self, x: f64) -> bool
pub fn crossing_x_value(&self, x: f64) -> bool
Tests whether this bounding box crosses a certain x value
Sourcepub fn crossing_y_value(&self, y: f64) -> bool
pub fn crossing_y_value(&self, y: f64) -> bool
Tests whether this bounding box crosses a certain y value
Sourcepub fn crossing_z_value(&self, z: f64) -> bool
pub fn crossing_z_value(&self, z: f64) -> bool
Tests whether this bounding box crosses a certain z value
Sourcepub fn distance<P>(&self, other: &P) -> NonNegativewhere
P: Is3D,
pub fn distance<P>(&self, other: &P) -> NonNegativewhere
P: Is3D,
Returns the distance to another Is3D
Sourcepub fn sqr_distance<P>(&self, other: &P) -> NonNegativewhere
P: Is3D,
pub fn sqr_distance<P>(&self, other: &P) -> NonNegativewhere
P: Is3D,
Returns the square distance to another Is3D
Trait Implementations§
Source§impl Clone for BoundingBox3D
impl Clone for BoundingBox3D
Source§fn clone(&self) -> BoundingBox3D
fn clone(&self) -> BoundingBox3D
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BoundingBox3D
impl Debug for BoundingBox3D
Source§impl Default for BoundingBox3D
impl Default for BoundingBox3D
Source§impl From<BoundingBox3D> for Box3D
impl From<BoundingBox3D> for Box3D
Source§fn from(x: BoundingBox3D) -> Self
fn from(x: BoundingBox3D) -> Self
Converts to this type from the input type.
Source§impl From<BoundingBox3D> for FilterBox3D
impl From<BoundingBox3D> for FilterBox3D
Source§fn from(x: BoundingBox3D) -> Self
fn from(x: BoundingBox3D) -> Self
Converts to this type from the input type.
Source§impl HasBoundingBox3D for BoundingBox3D
impl HasBoundingBox3D for BoundingBox3D
Source§fn bounding_box(&self) -> BoundingBox3D
fn bounding_box(&self) -> BoundingBox3D
Should return the bounding box
Source§impl HasBoundingBox3DMaybe for BoundingBox3D
impl HasBoundingBox3DMaybe for BoundingBox3D
Source§fn bounding_box_maybe(&self) -> Result<BoundingBox3D>
fn bounding_box_maybe(&self) -> Result<BoundingBox3D>
Should return the bounding box if it can be calculated
Source§impl HasDistanceTo<BoundingBox3D> for BoundingBox3D
impl HasDistanceTo<BoundingBox3D> for BoundingBox3D
Source§fn sqr_distance(&self, other: &BoundingBox3D) -> NonNegative
fn sqr_distance(&self, other: &BoundingBox3D) -> NonNegative
Should return the sqr distance to other
Source§fn distance(&self, other: &T) -> NonNegative
fn distance(&self, other: &T) -> NonNegative
The distance to other
Source§impl Hash for BoundingBox3D
impl Hash for BoundingBox3D
Source§impl Is3D for BoundingBox3D
impl Is3D for BoundingBox3D
Source§impl IsMergeable for BoundingBox3D
impl IsMergeable for BoundingBox3D
Source§impl IsMovable3D for BoundingBox3D
impl IsMovable3D for BoundingBox3D
Source§impl IsND for BoundingBox3D
impl IsND for BoundingBox3D
Source§fn n_dimensions() -> usize
fn n_dimensions() -> usize
Should return the number of dimensions. E.g. 2 for points in 2D space, 3 for points in 3D space etc.
Source§impl IsSATObject for BoundingBox3D
impl IsSATObject for BoundingBox3D
Source§impl IsScalable for BoundingBox3D
impl IsScalable for BoundingBox3D
Source§impl Ord for BoundingBox3D
impl Ord for BoundingBox3D
Source§fn cmp(&self, other: &BoundingBox3D) -> Ordering
fn cmp(&self, other: &BoundingBox3D) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for BoundingBox3D
impl PartialEq for BoundingBox3D
Source§impl PartialOrd for BoundingBox3D
impl PartialOrd for BoundingBox3D
impl Eq for BoundingBox3D
impl StructuralPartialEq for BoundingBox3D
Auto Trait Implementations§
impl Freeze for BoundingBox3D
impl RefUnwindSafe for BoundingBox3D
impl Send for BoundingBox3D
impl Sync for BoundingBox3D
impl Unpin for BoundingBox3D
impl UnwindSafe for BoundingBox3D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more