Struct parry3d::partitioning::QBVH
source · [−]pub struct QBVH<T> { /* private fields */ }
Expand description
A quaternary bounding-volume-hierarchy.
This is a bounding-volume-hierarchy where each node has either four children or none.
Implementations
sourceimpl<T: IndexedData> QBVH<T>
impl<T: IndexedData> QBVH<T>
sourcepub fn clear_and_rebuild(
&mut self,
data_gen: impl QBVHDataGenerator<T>,
dilation_factor: Real
)
pub fn clear_and_rebuild(
&mut self,
data_gen: impl QBVHDataGenerator<T>,
dilation_factor: Real
)
Clears this quaternary BVH and rebuilds it from a new set of data and AABBs.
sourceimpl<T: IndexedData> QBVH<T>
impl<T: IndexedData> QBVH<T>
sourcepub fn clear_and_rebuild_with_splitter(
&mut self,
data_gen: impl QBVHDataGenerator<T>,
splitter: impl QBVHDataSplitter<T>,
dilation_factor: Real
)
pub fn clear_and_rebuild_with_splitter(
&mut self,
data_gen: impl QBVHDataGenerator<T>,
splitter: impl QBVHDataSplitter<T>,
dilation_factor: Real
)
Clears this quaternary BVH and rebuilds it from a new set of data and AABBs.
sourceimpl<T: IndexedData> QBVH<T>
impl<T: IndexedData> QBVH<T>
sourcepub fn iter_data_mut(&mut self) -> impl Iterator<Item = (NodeIndex, &mut T)>
pub fn iter_data_mut(&mut self) -> impl Iterator<Item = (NodeIndex, &mut T)>
Iterates mutably through all the leaf data in this QBVH.
sourcepub fn iter_data(&self) -> impl Iterator<Item = (NodeIndex, &T)>
pub fn iter_data(&self) -> impl Iterator<Item = (NodeIndex, &T)>
Iterate through all the leaf data in this QBVH.
sourcepub fn leaf_data(&mut self, node_id: NodeIndex) -> Option<T>
pub fn leaf_data(&mut self, node_id: NodeIndex) -> Option<T>
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<T>]
pub fn raw_proxies(&self) -> &[QBVHProxy<T>]
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.
sourceimpl<T: IndexedData> QBVH<T>
impl<T: IndexedData> QBVH<T>
sourcepub fn traverse_depth_first(&self, visitor: &mut impl SimdVisitor<T, SimdAABB>)
pub fn traverse_depth_first(&self, visitor: &mut impl SimdVisitor<T, SimdAABB>)
Performs a depth-first traversal on the BVH.
sourcepub fn traverse_depth_first_with_stack(
&self,
visitor: &mut impl SimdVisitor<T, SimdAABB>,
stack: &mut Vec<u32>
)
pub fn traverse_depth_first_with_stack(
&self,
visitor: &mut impl SimdVisitor<T, SimdAABB>,
stack: &mut Vec<u32>
)
Performs a depth-first traversal on the BVH.
sourcepub fn traverse_best_first<BFS>(
&self,
visitor: &mut BFS
) -> Option<(NodeIndex, BFS::Result)> where
BFS: SimdBestFirstVisitor<T, SimdAABB>,
BFS::Result: Clone,
pub fn traverse_best_first<BFS>(
&self,
visitor: &mut BFS
) -> Option<(NodeIndex, BFS::Result)> where
BFS: SimdBestFirstVisitor<T, SimdAABB>,
BFS::Result: Clone,
Performs a best-first-search on the BVH.
Returns the content of the leaf with the smallest associated cost, and a result of user-defined type.
sourcepub fn intersect_aabb(&self, aabb: &AABB, out: &mut Vec<T>)
pub fn intersect_aabb(&self, aabb: &AABB, out: &mut Vec<T>)
Retrieve all the data of the nodes with AABBs intersecting the given AABB:
sourcepub fn traverse_bvtt<T2: IndexedData>(
&self,
qbvh2: &QBVH<T2>,
visitor: &mut impl SimdSimultaneousVisitor<T, T2, SimdAABB>
)
pub fn traverse_bvtt<T2: IndexedData>(
&self,
qbvh2: &QBVH<T2>,
visitor: &mut impl SimdSimultaneousVisitor<T, T2, SimdAABB>
)
Performs a simultaneous traversal of two QBVH.
sourcepub fn traverse_bvtt_with_stack<T2: IndexedData>(
&self,
qbvh2: &QBVH<T2>,
visitor: &mut impl SimdSimultaneousVisitor<T, T2, SimdAABB>,
stack: &mut Vec<(u32, u32)>
)
pub fn traverse_bvtt_with_stack<T2: IndexedData>(
&self,
qbvh2: &QBVH<T2>,
visitor: &mut impl SimdSimultaneousVisitor<T, T2, SimdAABB>,
stack: &mut Vec<(u32, u32)>
)
Performs a simultaneous traversal of two QBVH.
sourceimpl<T: IndexedData> QBVH<T>
impl<T: IndexedData> QBVH<T>
sourcepub fn pre_update(&mut self, data: T)
pub fn pre_update(&mut self, data: T)
Marks a piece of data as dirty so it can be updated during the next
call to self.update
.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for QBVH<T> where
T: RefUnwindSafe,
impl<T> Send for QBVH<T> where
T: Send,
impl<T> Sync for QBVH<T> where
T: Sync,
impl<T> Unpin for QBVH<T> where
T: Unpin,
impl<T> UnwindSafe for QBVH<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
sourceimpl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
sourcefn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
sourcefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
sourcefn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
sourcefn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more