pub struct Box3D {
pub position: Vector3D<u64>,
pub size: Vector3D<u64>,
pub id: usize,
pub origin: u16,
}Expand description
The structure of a 3-dimensional box
Fields§
§position: Vector3D<u64>Corresponds to x,y,z properties
size: Vector3D<u64>Corresponds to w,h,l properties
id: usizeID for each box
origin: u16Keeps a trace of how the box evolved (only for debugging)
Implementations§
Source§impl Box3D
impl Box3D
Sourcepub fn from_position_size(
position: Vector3D<u64>,
size: Vector3D<u64>,
id: usize,
origin: u16,
) -> Box3D
pub fn from_position_size( position: Vector3D<u64>, size: Vector3D<u64>, id: usize, origin: u16, ) -> Box3D
Create Box3D from position, and size
Sourcepub fn from_xyz_whl(
x: u64,
y: u64,
z: u64,
w: u64,
h: u64,
l: u64,
id: usize,
origin: u16,
) -> Box3D
pub fn from_xyz_whl( x: u64, y: u64, z: u64, w: u64, h: u64, l: u64, id: usize, origin: u16, ) -> Box3D
Create Box3D from xyz, and whl
pub fn x2(&self) -> u64
pub fn y2(&self) -> u64
pub fn z2(&self) -> u64
Sourcepub fn intersects(&self, other: &Box3D) -> bool
pub fn intersects(&self, other: &Box3D) -> bool
Box strictly (doesn’t only touch) intersects other
Sourcepub fn is_covered_among(&self, boxes: &HashSetFnv<Box3D>) -> bool
pub fn is_covered_among(&self, boxes: &HashSetFnv<Box3D>) -> bool
Returns whether Box is covered among other Boxes
Sourcepub fn get_rotations(&self) -> Vec<Box3D>
pub fn get_rotations(&self) -> Vec<Box3D>
Gets the new 6 boxes with sizes adjusted according to rotation
Trait Implementations§
impl Copy for Box3D
impl Eq for Box3D
impl StructuralPartialEq for Box3D
Auto Trait Implementations§
impl Freeze for Box3D
impl RefUnwindSafe for Box3D
impl Send for Box3D
impl Sync for Box3D
impl Unpin for Box3D
impl UnwindSafe for Box3D
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