pub struct SpatialHashGrid2 { /* private fields */ }Expand description
Reusable spatial hash grid for 2D broad-phase collision detection.
Implementations§
Source§impl SpatialHashGrid2
impl SpatialHashGrid2
Sourcepub fn new(config: BroadPhase2Config) -> Result<Self>
pub fn new(config: BroadPhase2Config) -> Result<Self>
Creates a new value.
Sourcepub fn rebuild(&mut self, bounds: &[RectU32]) -> Result<()>
pub fn rebuild(&mut self, bounds: &[RectU32]) -> Result<()>
Rebuilds this grid for a single set of bounds.
Sourcepub fn candidate_pairs(&mut self) -> Result<&[CollisionPair]>
pub fn candidate_pairs(&mut self) -> Result<&[CollisionPair]>
Returns candidate pairs for the most recently rebuilt single set.
Sourcepub fn candidate_pairs_between(
&mut self,
left: &[RectU32],
right: &[RectU32],
) -> Result<&[CollisionPair]>
pub fn candidate_pairs_between( &mut self, left: &[RectU32], right: &[RectU32], ) -> Result<&[CollisionPair]>
Returns candidate pairs between two independent sets.
Sourcepub fn stats(&self) -> BroadPhaseStats
pub fn stats(&self) -> BroadPhaseStats
Returns stats.
Trait Implementations§
Source§impl Clone for SpatialHashGrid2
impl Clone for SpatialHashGrid2
Source§fn clone(&self) -> SpatialHashGrid2
fn clone(&self) -> SpatialHashGrid2
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 moreAuto Trait Implementations§
impl Freeze for SpatialHashGrid2
impl RefUnwindSafe for SpatialHashGrid2
impl Send for SpatialHashGrid2
impl Sync for SpatialHashGrid2
impl Unpin for SpatialHashGrid2
impl UnsafeUnpin for SpatialHashGrid2
impl UnwindSafe for SpatialHashGrid2
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