pub struct SweepAndPrune { /* private fields */ }Expand description
Sweep-and-Prune broadphase. Sorts bodies by X-axis AABB min bound, then sweeps to find overlapping intervals. Y/Z overlap checked inline. Pre-allocates all Vecs for Clean Compute (zero per-step allocation).
Implementations§
Source§impl SweepAndPrune
impl SweepAndPrune
pub fn new() -> Self
Sourcepub fn populate(&mut self, bodies: &[RigidBody])
pub fn populate(&mut self, bodies: &[RigidBody])
Populate from body arrays. Extracts AABBs and sorts by X-axis min.
Sourcepub fn query_pairs(&mut self) -> &[(usize, usize)]
pub fn query_pairs(&mut self) -> &[(usize, usize)]
Sweep-and-prune pair generation. Returns pre-allocated pairs Vec (no allocation). Pairs are canonical (i < j) by construction — zero duplicates.
Trait Implementations§
Source§impl Clone for SweepAndPrune
impl Clone for SweepAndPrune
Source§fn clone(&self) -> SweepAndPrune
fn clone(&self) -> SweepAndPrune
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SweepAndPrune
impl RefUnwindSafe for SweepAndPrune
impl Send for SweepAndPrune
impl Sync for SweepAndPrune
impl Unpin for SweepAndPrune
impl UnsafeUnpin for SweepAndPrune
impl UnwindSafe for SweepAndPrune
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