#[non_exhaustive]pub enum Broadphase {
Bvh,
DynamicTree,
Hybrid,
}Expand description
The broad-phase PhysicsWorld uses to find the pairs of bodies whose
colliders may touch.
A body’s box is the closed-form world box of its collider when it carries a
shape or a compound, and the cube of its collision sphere otherwise. Every
kind hands its candidates (pairs whose boxes may overlap) to the
same exact narrow-phase in ascending pair order, and a pair whose boxes do not
meet has no contact, so a world steps to bit-identical results whichever
it uses; they differ in cost. Set with PhysicsWorld::set_broadphase.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bvh
A linear BVH over Morton codes, rebuilt from scratch every step. Default.
DynamicTree
A persistent dynamic AABB tree (crate::dynamic_bvh::DynamicAabbTree):
each body keeps a fattened proxy that is only re-inserted when the body
leaves it, so a world where most bodies move little pays for the few that do.
Hybrid
Static bodies in a BVH rebuilt only when the static set changes, small
dynamic bodies in a sparse hash grid whose cell size follows the median
body, and large dynamic bodies in a per-step BVH; reports exactly the
pairs whose boxes overlap. Fastest when many bodies are static or bodies
are of similar size. The sleep skip (PhysicsWorld::set_sleep_skip)
parks bodies only with Broadphase::Bvh; with this kind every body is
staged every step.
Trait Implementations§
Source§impl Clone for Broadphase
impl Clone for Broadphase
impl Copy for Broadphase
Source§impl Debug for Broadphase
impl Debug for Broadphase
Source§impl Default for Broadphase
impl Default for Broadphase
impl Eq for Broadphase
Source§impl PartialEq for Broadphase
impl PartialEq for Broadphase
impl StructuralPartialEq for Broadphase
Auto Trait Implementations§
impl Freeze for Broadphase
impl RefUnwindSafe for Broadphase
impl Send for Broadphase
impl Sync for Broadphase
impl Unpin for Broadphase
impl UnsafeUnpin for Broadphase
impl UnwindSafe for Broadphase
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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 more