pub trait BVH<T, BV> {
    type Node: Copy;

    // Required methods
    fn root(&self) -> Option<Self::Node>;
    fn num_children(&self, node: Self::Node) -> usize;
    fn child(&self, i: usize, node: Self::Node) -> Self::Node;
    fn content(&self, node: Self::Node) -> (&BV, Option<&T>);

    // Provided methods
    fn visit(&self, visitor: &mut impl Visitor<T, BV>) { ... }
    fn visit_bvtt(
        &self,
        other: &impl BVH<T, BV>,
        visitor: &mut impl SimultaneousVisitor<T, BV>
    ) { ... }
    fn best_first_search<N, BFS>(
        &self,
        visitor: &mut BFS
    ) -> Option<(Self::Node, <BFS as BestFirstVisitor<N, T, BV>>::Result)>
       where N: RealField + Copy,
             BFS: BestFirstVisitor<N, T, BV> { ... }
}
Expand description

Trait implemented by Bounding Volume Hierarchy.

Required Associated Types§

source

type Node: Copy

Type of a node identifiers on this BVH.

Required Methods§

source

fn root(&self) -> Option<Self::Node>

The root of the BVH.

source

fn num_children(&self, node: Self::Node) -> usize

The number of children of the given node.

source

fn child(&self, i: usize, node: Self::Node) -> Self::Node

The i-th child of the given node.

source

fn content(&self, node: Self::Node) -> (&BV, Option<&T>)

The bounding volume and data contained by the given node.

Provided Methods§

source

fn visit(&self, visitor: &mut impl Visitor<T, BV>)

Traverses this BVH using a visitor.

source

fn visit_bvtt( &self, other: &impl BVH<T, BV>, visitor: &mut impl SimultaneousVisitor<T, BV> )

Visits the bounding volume test tree implicitly formed with other.

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.

Implementors§

source§

impl<'a, N, T, BV> BVH<T, BV> for DBVT<N, T, BV>where N: RealField + Copy,

source§

impl<'a, T, BV> BVH<T, BV> for BVT<T, BV>