[][src]Struct ncollide3d::partitioning::BVT

pub struct BVT<T, BV> { /* fields omitted */ }

A Bounding Volume Tree.

Methods

impl<T, BV> BVT<T, BV>[src]

pub fn new_with_partitioning<F: FnMut(usize, Vec<(T, BV)>) -> (BV, BinaryPartition<T, BV>)>(
    elements: Vec<(T, BV)>,
    partitioning: &mut F
) -> BVT<T, BV>
[src]

Deprecated:

please use from_partitioning instead

Builds a bounding volume tree using the specified partitioning function.

pub fn from_partitioning(
    elements: Vec<(T, BV)>,
    partitioning: &mut impl FnMut(usize, Vec<(T, BV)>) -> (BV, BinaryPartition<T, BV>)
) -> BVT<T, BV>
[src]

Builds a bounding volume tree using the specified partitioning function.

pub fn leaves(&self) -> &[BVTLeaf<T, BV>][src]

The set of leaves on this BVT.

pub fn leaf(&self, i: usize) -> &BVTLeaf<T, BV>[src]

Referenceto the i-th leaf of this BVT.

pub fn root_bounding_volume(&self) -> Option<&BV>[src]

Reference to the bounding volume of the tree root.

pub fn set_leaf_bounding_volume<N: Real>(
    &mut self,
    i: usize,
    bv: BV,
    refit_now: bool
) where
    BV: BoundingVolume<N>, 
[src]

Set the bounding volume of the i-th leaf.

If refit_now is true, the bounding volumes of all the ancestors of the modifiad leaf will be updated as well to enclose the new leaf bounding volume. If refit_now is false, no ancestor update will be performed until the .refit() method is called. This is useful to refit the tree only once after several leaf bounding volume modifications.

pub fn refit<N: Real>(&mut self, margin: N) where
    BV: BoundingVolume<N>, 
[src]

Refits the bounding volumes so that all node of the BVT have boundin volumes that enclose their children.

This must be called to ensure the BVT is in a valid state after several calls to .set_leaf_bounding_volume(_, _, false). Every bounding volume created during this update will be enlarged by a margin of margin. The larger this margin here, the looser will the resulting AABB will be, but the less frequent future updates will be necessary. Setting a margin equal to 0.0 is allowed.

impl<T, BV> BVT<T, BV>[src]

pub fn new_balanced<N>(leaves: Vec<(T, BV)>) -> BVT<T, BV> where
    N: Real,
    BV: BoundingVolume<N> + Clone
[src]

Creates a balanced BVT.

pub fn median_partitioning_with_centers<N, F: FnMut(&T, &BV) -> Point<N>>(
    depth: usize,
    leaves: Vec<(T, BV)>,
    center: &mut F
) -> (BV, BinaryPartition<T, BV>) where
    N: Real,
    BV: BoundingVolume<N> + Clone
[src]

Construction function for a kdree to be used with BVT::from_partitioning.

pub fn median_partitioning<N>(
    depth: usize,
    leaves: Vec<(T, BV)>
) -> (BV, BinaryPartition<T, BV>) where
    N: Real,
    BV: BoundingVolume<N> + Clone
[src]

Construction function for a kdree to be used with BVT::from_partitioning.

Trait Implementations

impl<'a, T, BV> BVH<T, BV> for BVT<T, BV>[src]

type Node = BVTNodeId

Type of a node of this BVH.

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

Traverses this BVH using a visitor.

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

Visits the bounding volume test tree implicitly formed with other.

Performs a best-fist-search on the BVH. Read more

impl<T: Clone, BV: Clone> Clone for BVT<T, BV>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<T, BV> Send for BVT<T, BV> where
    BV: Send,
    T: Send

impl<T, BV> Sync for BVT<T, BV> where
    BV: Sync,
    T: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> Same for T

type Output = T

Should always be Self