pub struct BoxOctree {
boundary: BoundingBox,
boundary_quarters: DeflatedQuarters,
size: IVec3,
depth: u32,
inner_boxes: Vec<StoredBox>,
children: Vec<BoxOctree>,
}Expand description
Octree of axis-aligned boxes for fast intersection queries during jigsaw assembly.
Fields§
§boundary: BoundingBox§boundary_quarters: DeflatedQuarters§size: IVec3§depth: u32§inner_boxes: Vec<StoredBox>§children: Vec<BoxOctree>Implementations§
Source§impl BoxOctree
impl BoxOctree
pub fn new(boundary: BoundingBox) -> Self
fn with_depth( boundary: BoundingBox, boundary_quarters: DeflatedQuarters, parent_depth: u32, ) -> Self
pub fn add_box(&mut self, bbox: BoundingBox)
Sourcepub fn within_bounds_but_not_intersecting_children(
&self,
candidate: BoundingBox,
) -> bool
pub fn within_bounds_but_not_intersecting_children( &self, candidate: BoundingBox, ) -> bool
Vanilla jigsaw placement uses AABB.of(bb).deflate(0.25) before collision checks.
fn intersects_deflated( &self, deflated: DeflatedQuarters, candidate: BoundingBox, ) -> bool
fn boundary_intersects(&self, candidate: BoundingBox) -> bool
fn subdivide(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BoxOctree
impl RefUnwindSafe for BoxOctree
impl Send for BoxOctree
impl Sync for BoxOctree
impl Unpin for BoxOctree
impl UnsafeUnpin for BoxOctree
impl UnwindSafe for BoxOctree
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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 moreWraps this value in an
Arc<SyncMutex<>>