Struct plane_split::BspSplitter
source · pub struct BspSplitter<A: Copy> { /* private fields */ }
Expand description
Binary Space Partitioning splitter, uses a BSP tree.
Implementations
sourceimpl<A: Copy> BspSplitter<A>
impl<A: Copy> BspSplitter<A>
sourceimpl<A> BspSplitter<A>where
A: Copy + Debug + Default,
impl<A> BspSplitter<A>where
A: Copy + Debug + Default,
sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Put the splitter back in it initial state.
Call this at the beginning of every frame when reusing the splitter.
sourcepub fn add(&mut self, poly: Polygon<A>)
pub fn add(&mut self, poly: Polygon<A>)
Add a polygon to the plane splitter.
This is where most of the expensive computation happens.
sourcepub fn sort(&mut self, view: Vector3D<f64>) -> &[Polygon<A>]
pub fn sort(&mut self, view: Vector3D<f64>) -> &[Polygon<A>]
Sort the added and split polygons against the view vector.
Call this towards the end of the frame after having added all polygons.
Auto Trait Implementations
impl<A> RefUnwindSafe for BspSplitter<A>where
A: RefUnwindSafe,
impl<A> Send for BspSplitter<A>where
A: Send,
impl<A> Sync for BspSplitter<A>where
A: Sync,
impl<A> Unpin for BspSplitter<A>where
A: Unpin,
impl<A> UnwindSafe for BspSplitter<A>where
A: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more