Struct BoundingBox
pub struct BoundingBox {
pub min: [i32; 3],
pub max: [i32; 3],
}Expand description
Inclusive integer box (vanilla BoundingBox). The default is the one block at the origin.
Fields§
§min: [i32; 3]§max: [i32; 3]Implementations§
§impl BoundingBox
impl BoundingBox
pub fn new(min: [i32; 3], max: [i32; 3]) -> BoundingBox
pub fn from_corners(a: [i32; 3], b: [i32; 3]) -> BoundingBox
pub fn moved(self, d: [i32; 3]) -> BoundingBox
pub fn is_inside(&self, p: [i32; 3]) -> bool
pub fn intersects(&self, other: &BoundingBox) -> bool
pub fn encapsulate(&mut self, other: &BoundingBox)
pub fn inflated(self, xz: i32, y: i32) -> BoundingBox
pub fn span(&self) -> [i32; 3]
pub fn center(&self) -> [i32; 3]
pub fn corners(&self) -> [[i32; 3]; 8]
Trait Implementations§
§impl Clone for BoundingBox
impl Clone for BoundingBox
§fn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BoundingBox
§impl Debug for BoundingBox
impl Debug for BoundingBox
§impl Default for BoundingBox
impl Default for BoundingBox
§fn default() -> BoundingBox
fn default() -> BoundingBox
Returns the “default value” for a type. Read more
impl Eq for BoundingBox
§impl Hash for BoundingBox
impl Hash for BoundingBox
§impl PartialEq for BoundingBox
impl PartialEq for BoundingBox
impl StructuralPartialEq for BoundingBox
Auto Trait Implementations§
impl Freeze for BoundingBox
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin for BoundingBox
impl UnsafeUnpin for BoundingBox
impl UnwindSafe for BoundingBox
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