[−][src]Struct oxygengine_physics_2d::prelude::ncollide2d::partitioning::BVT
A Bounding Volume Tree.
Implementations
impl<T, BV> BVT<T, BV>
[src]
pub fn new_with_partitioning<F>(
elements: Vec<(T, BV)>,
partitioning: &mut F
) -> BVT<T, BV> where
F: FnMut(usize, Vec<(T, BV)>) -> (BV, BinaryPartition<T, BV>),
[src]
elements: Vec<(T, BV)>,
partitioning: &mut F
) -> BVT<T, BV> where
F: FnMut(usize, Vec<(T, BV)>) -> (BV, BinaryPartition<T, BV>),
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]
elements: Vec<(T, BV)>,
partitioning: &mut impl FnMut(usize, Vec<(T, BV)>) -> (BV, BinaryPartition<T, BV>)
) -> BVT<T, BV>
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>(&mut self, i: usize, bv: BV, refit_now: bool) where
BV: BoundingVolume<N>,
N: RealField,
[src]
BV: BoundingVolume<N>,
N: RealField,
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>(&mut self, margin: N) where
BV: BoundingVolume<N>,
N: RealField,
[src]
BV: BoundingVolume<N>,
N: RealField,
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
BV: BoundingVolume<N> + Clone,
N: RealField,
[src]
BV: BoundingVolume<N> + Clone,
N: RealField,
Creates a balanced BVT
.
pub fn median_partitioning_with_centers<N, F>(
depth: usize,
leaves: Vec<(T, BV)>,
center: &mut F
) -> (BV, BinaryPartition<T, BV>) where
BV: BoundingVolume<N> + Clone,
F: FnMut(&T, &BV) -> Point<N, U2>,
N: RealField,
[src]
depth: usize,
leaves: Vec<(T, BV)>,
center: &mut F
) -> (BV, BinaryPartition<T, BV>) where
BV: BoundingVolume<N> + Clone,
F: FnMut(&T, &BV) -> Point<N, U2>,
N: RealField,
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
BV: BoundingVolume<N> + Clone,
N: RealField,
[src]
depth: usize,
leaves: Vec<(T, BV)>
) -> (BV, BinaryPartition<T, BV>) where
BV: BoundingVolume<N> + Clone,
N: RealField,
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 identifiers on this BVH.
fn root(&self) -> Option<<BVT<T, BV> as BVH<T, BV>>::Node>
[src]
fn num_children(&self, node: <BVT<T, BV> as BVH<T, BV>>::Node) -> usize
[src]
fn child(
&self,
i: usize,
node: <BVT<T, BV> as BVH<T, BV>>::Node
) -> <BVT<T, BV> as BVH<T, BV>>::Node
[src]
&self,
i: usize,
node: <BVT<T, BV> as BVH<T, BV>>::Node
) -> <BVT<T, BV> as BVH<T, BV>>::Node
fn content(&self, node: <BVT<T, BV> as BVH<T, BV>>::Node) -> (&BV, Option<&T>)
[src]
fn visit(&self, visitor: &mut impl Visitor<T, BV>)
[src]
fn visit_bvtt(
&self,
other: &impl BVH<T, BV>,
visitor: &mut impl SimultaneousVisitor<T, BV>
)
[src]
&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
BFS: BestFirstVisitor<N, T, BV>,
N: RealField,
[src]
&self,
visitor: &mut BFS
) -> Option<(Self::Node, <BFS as BestFirstVisitor<N, T, BV>>::Result)> where
BFS: BestFirstVisitor<N, T, BV>,
N: RealField,
impl<T, BV> Clone for BVT<T, BV> where
BV: Clone,
T: Clone,
[src]
BV: Clone,
T: Clone,
impl<'de, T, BV> Deserialize<'de> for BVT<T, BV> where
BV: Deserialize<'de>,
T: Deserialize<'de>,
[src]
BV: Deserialize<'de>,
T: Deserialize<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<BVT<T, BV>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<BVT<T, BV>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl<T, BV> Serialize for BVT<T, BV> where
BV: Serialize,
T: Serialize,
[src]
BV: Serialize,
T: Serialize,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Auto Trait Implementations
impl<T, BV> RefUnwindSafe for BVT<T, BV> where
BV: RefUnwindSafe,
T: RefUnwindSafe,
BV: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, BV> Send for BVT<T, BV> where
BV: Send,
T: Send,
BV: Send,
T: Send,
impl<T, BV> Sync for BVT<T, BV> where
BV: Sync,
T: Sync,
BV: Sync,
T: Sync,
impl<T, BV> Unpin for BVT<T, BV> where
BV: Unpin,
T: Unpin,
BV: Unpin,
T: Unpin,
impl<T, BV> UnwindSafe for BVT<T, BV> where
BV: UnwindSafe,
T: UnwindSafe,
BV: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: Any,
T: Any,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UserData for T where
T: Clone + Send + Sync + Any,
[src]
T: Clone + Send + Sync + Any,
fn clone_boxed(&self) -> Box<dyn UserData + 'static>
[src]
fn to_any(&self) -> Box<dyn Any + 'static + Sync + Send>
[src]
fn as_any(&self) -> &(dyn Any + 'static + Sync + Send)
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,