pub struct Cuboid<T> {
pub top_left_back: Coordinate3d<T>,
pub bottom_right_front: Coordinate3d<T>,
}Expand description
Describes a cuboid aligned with the x,y,z axes by way of its top left back and bottom right front corners
Fields§
§top_left_back: Coordinate3d<T>§bottom_right_front: Coordinate3d<T>Implementations§
Source§impl<T: Integer + Copy> Cuboid<T>
impl<T: Integer + Copy> Cuboid<T>
Sourcepub fn new(first: Coordinate3d<T>, second: Coordinate3d<T>) -> Cuboid<T>
pub fn new(first: Coordinate3d<T>, second: Coordinate3d<T>) -> Cuboid<T>
Takes any two points in space and to build the Cuboid defined by them.
Sourcepub fn intersection(&self, other: &Self) -> Option<Self>
pub fn intersection(&self, other: &Self) -> Option<Self>
If the supplied Cuboid intersects with this one, returns the cuboid defined by the intersection points between the two. Otherwise return None
Sourcepub fn contains(&self, point: &Coordinate3d<T>) -> bool
pub fn contains(&self, point: &Coordinate3d<T>) -> bool
Does the cuboid contain the specified point in space?
Trait Implementations§
impl<T: Copy> Copy for Cuboid<T>
impl<T: Eq> Eq for Cuboid<T>
impl<T> StructuralPartialEq for Cuboid<T>
Auto Trait Implementations§
impl<T> Freeze for Cuboid<T>where
T: Freeze,
impl<T> RefUnwindSafe for Cuboid<T>where
T: RefUnwindSafe,
impl<T> Send for Cuboid<T>where
T: Send,
impl<T> Sync for Cuboid<T>where
T: Sync,
impl<T> Unpin for Cuboid<T>where
T: Unpin,
impl<T> UnwindSafe for Cuboid<T>where
T: UnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.