pub struct Bvh { /* private fields */ }Implementations§
Source§impl Bvh
impl Bvh
pub fn build(tris: &[[[f64; 3]; 3]]) -> Bvh
Sourcepub fn ray_candidates(&self, p: [f64; 3], far: [f64; 3], out: &mut Vec<u32>)
pub fn ray_candidates(&self, p: [f64; 3], far: [f64; 3], out: &mut Vec<u32>)
Append the index of every triangle whose (padded) AABB the segment
p→far may pass through — a conservative superset of the triangles the
exact ray could hit. Used to turn the O(N) point_inside ray-cast into an
O(log N + hits) one without changing its parity result.
Sourcepub fn point_candidates(&self, p: [f64; 3], radius: f64, out: &mut Vec<u32>)
pub fn point_candidates(&self, p: [f64; 3], radius: f64, out: &mut Vec<u32>)
Append the index of every triangle whose AABB, grown by radius (plus the
conservative pad), contains point p. radius = 0 ⇒ exact-on-surface
candidates; radius = band ⇒ near-coplanar-flush candidates. A conservative
superset, so the exact per-triangle test that follows decides the verdict.
Auto Trait Implementations§
impl Freeze 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.