Type Alias parry3d_f64::partitioning::Qbvh
source · pub type Qbvh<LeafData> = GenericQbvh<LeafData, DefaultStorage>;
Expand description
A quaternary bounding-volume-hierarchy.
This is a bounding-volume-hierarchy where each node has either four children or none.
Aliased Type§
struct Qbvh<LeafData> { /* private fields */ }
Implementations§
source§impl<LeafData: IndexedData> Qbvh<LeafData>
impl<LeafData: IndexedData> Qbvh<LeafData>
sourcepub fn iter_data_mut(
&mut self
) -> impl Iterator<Item = (NodeIndex, &mut LeafData)>
pub fn iter_data_mut( &mut self ) -> impl Iterator<Item = (NodeIndex, &mut LeafData)>
Iterates mutably through all the leaf data in this Qbvh.
sourcepub fn iter_data(&self) -> impl Iterator<Item = (NodeIndex, &LeafData)>
pub fn iter_data(&self) -> impl Iterator<Item = (NodeIndex, &LeafData)>
Iterate through all the leaf data in this Qbvh.
sourcepub fn leaf_data(&self, node_id: NodeIndex) -> Option<LeafData>
pub fn leaf_data(&self, node_id: NodeIndex) -> Option<LeafData>
Returns the data associated to a given leaf.
Returns None
if the provided node ID does not identify a leaf.
sourcepub fn raw_nodes(&self) -> &[QbvhNode]
pub fn raw_nodes(&self) -> &[QbvhNode]
The raw nodes of this BVH.
If this Qbvh isn’t empty, the first element of the returned slice is the root of the tree. The other elements are not arranged in any particular order. The more high-level traversal methods should be used instead of this.
sourcepub fn raw_proxies(&self) -> &[QbvhProxy<LeafData>]
pub fn raw_proxies(&self) -> &[QbvhProxy<LeafData>]
The raw proxies of this BVH.
If this Qbvh isn’t empty, the first element of the returned slice is the root of the tree. The other elements are not arranged in any particular order. The more high-level traversal methods should be used instead of this.
source§impl<LeafData: IndexedData> Qbvh<LeafData>
impl<LeafData: IndexedData> Qbvh<LeafData>
sourcepub fn clear_and_rebuild(
&mut self,
data_gen: impl QbvhDataGenerator<LeafData>,
dilation_factor: Real
)
pub fn clear_and_rebuild( &mut self, data_gen: impl QbvhDataGenerator<LeafData>, dilation_factor: Real )
Clears this quaternary BVH and rebuilds it from a new set of data and Aabbs.
source§impl<LeafData: IndexedData> Qbvh<LeafData>
impl<LeafData: IndexedData> Qbvh<LeafData>
sourcepub fn clear_and_rebuild_with_splitter(
&mut self,
data_gen: impl QbvhDataGenerator<LeafData>,
splitter: impl QbvhDataSplitter<LeafData>,
dilation_factor: Real
)
pub fn clear_and_rebuild_with_splitter( &mut self, data_gen: impl QbvhDataGenerator<LeafData>, splitter: impl QbvhDataSplitter<LeafData>, dilation_factor: Real )
Clears this quaternary BVH and rebuilds it from a new set of data and Aabbs.
source§impl<LeafData: IndexedData> Qbvh<LeafData>
impl<LeafData: IndexedData> Qbvh<LeafData>
sourcepub fn remove(&mut self, data: LeafData) -> Option<LeafData>
pub fn remove(&mut self, data: LeafData) -> Option<LeafData>
Immediately remove a leaf from this QBVH.
sourcepub fn pre_update_or_insert(&mut self, data: LeafData)
pub fn pre_update_or_insert(&mut self, data: LeafData)
Prepare a new leaf for insertion into this QBVH (or for update if it already exists).
The insertion or update will be completely valid only after the next call to Qbvh::refit
.
sourcepub fn refit<F>(
&mut self,
margin: Real,
workspace: &mut QbvhUpdateWorkspace,
aabb_builder: F
) -> usize
pub fn refit<F>( &mut self, margin: Real, workspace: &mut QbvhUpdateWorkspace, aabb_builder: F ) -> usize
Update all the nodes that have been marked as dirty by Qbvh::pre_update_or_insert
,
and Qbvh::remove
.
This will not alter the topology of this Qbvh
.
sourcepub fn rebalance(&mut self, margin: Real, workspace: &mut QbvhUpdateWorkspace)
pub fn rebalance(&mut self, margin: Real, workspace: &mut QbvhUpdateWorkspace)
Rebalances the Qbvh
tree.
This will modify the topology of this tree. This assumes that the leaf AABBs have
already been updated with Qbvh::refit
.