pub struct Bvh { /* private fields */ }Expand description
Static BVH over per-item boxes; queries return indices into the slice the tree was built from.
Implementations§
Source§impl Bvh
impl Bvh
pub fn build(boxes: &[Aabb]) -> Self
Sourcepub fn overlapping(&self, query: Aabb, tolerance: f64, out: &mut Vec<usize>)
pub fn overlapping(&self, query: Aabb, tolerance: f64, out: &mut Vec<usize>)
Collect indices whose box overlaps query expanded by tolerance.
Sourcepub fn intersecting_segment(
&self,
start: Vec3,
end: Vec3,
tolerance: f64,
out: &mut Vec<usize>,
)
pub fn intersecting_segment( &self, start: Vec3, end: Vec3, tolerance: f64, out: &mut Vec<usize>, )
Collect indices whose box (expanded by tolerance) intersects the
segment from start to end.
Sourcepub fn intersecting_ray(
&self,
origin: Vec3,
direction: Vec3,
tolerance: f64,
out: &mut Vec<usize>,
)
pub fn intersecting_ray( &self, origin: Vec3, direction: Vec3, tolerance: f64, out: &mut Vec<usize>, )
Collect indices whose box intersects the forward ray. Unlike a segment
query this has no far limit (camera clipping planes need not bound CPU
picking). direction need not be normalized; boxes behind the origin
are excluded and grazing hits are retained.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Bvh
impl Freeze for Bvh
impl Move for Bvh
impl RefUnwindSafe for Bvh
impl Send for Bvh
impl Sync for Bvh
impl Unpin for Bvh
impl UnsafeUnpin for Bvh
impl UnwindSafe for Bvh
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