pub struct DynamicAabbTree {
pub margin: Fix128,
pub metric: MetricWeights,
/* private fields */
}Expand description
Dynamic AABB Tree for incremental broadphase
Fields§
§margin: Fix128AABB fattening margin
metric: MetricWeightsThe metric margin is measured in.
A margin is a clearance, so under a non-Euclidean metric it has to
be converted before it can pad a Euclidean box: a clearance of m in
the cube metric reaches √3·m in Euclidean space, and padding by the
plain m lets pairs through the broadphase. Euclidean by default,
and that path is bit-identical to having no metric at all.
Implementations§
Source§impl DynamicAabbTree
impl DynamicAabbTree
Sourcepub fn insert(&mut self, aabb: AABB, user_data: u32) -> u32
pub fn insert(&mut self, aabb: AABB, user_data: u32) -> u32
Insert a new AABB, returns the proxy (node) ID
Sourcepub fn update(&mut self, proxy_id: u32, new_aabb: AABB) -> bool
pub fn update(&mut self, proxy_id: u32, new_aabb: AABB) -> bool
Update a proxy’s AABB. Returns true if the tree was modified.
Only re-inserts if the tight AABB has left the fat AABB.
Sourcepub fn query_callback<F: FnMut(u32)>(&self, aabb: &AABB, callback: F)
pub fn query_callback<F: FnMut(u32)>(&self, aabb: &AABB, callback: F)
Query with callback (avoids allocation)
Sourcepub fn find_pairs(&self) -> Vec<(u32, u32)>
pub fn find_pairs(&self) -> Vec<(u32, u32)>
Find all potentially overlapping pairs
Sourcepub fn proxy_count(&self) -> usize
pub fn proxy_count(&self) -> usize
Number of active proxies (leaf nodes)
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Total node count (including internal)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DynamicAabbTree
impl RefUnwindSafe for DynamicAabbTree
impl Send for DynamicAabbTree
impl Sync for DynamicAabbTree
impl Unpin for DynamicAabbTree
impl UnsafeUnpin for DynamicAabbTree
impl UnwindSafe for DynamicAabbTree
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> 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 more