pub struct Bvh<T: Clone> {
pub item_count: usize,
/* private fields */
}Expand description
A complete BVH tree.
Fields§
§item_count: usizeImplementations§
Source§impl<T: Clone> Bvh<T>
impl<T: Clone> Bvh<T>
Sourcepub fn build(items: Vec<(Aabb, T)>) -> Self
pub fn build(items: Vec<(Aabb, T)>) -> Self
Build a BVH from a list of (bounds, item) pairs using SAH heuristic.
pub fn query_sphere(&self, center: Vec3, radius: f32) -> Vec<T>
pub fn query_ray(&self, origin: Vec3, dir: Vec3, max_t: f32) -> Vec<(T, f32)>
pub fn query_aabb(&self, bounds: &Aabb) -> Vec<T>
pub fn is_empty(&self) -> bool
pub fn item_count(&self) -> usize
Auto Trait Implementations§
impl<T> Freeze for Bvh<T>where
T: Freeze,
impl<T> RefUnwindSafe for Bvh<T>where
T: RefUnwindSafe,
impl<T> Send for Bvh<T>where
T: Send,
impl<T> Sync for Bvh<T>where
T: Sync,
impl<T> Unpin for Bvh<T>where
T: Unpin,
impl<T> UnsafeUnpin for Bvh<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Bvh<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more