pub struct Bvh { /* private fields */ }Implementations§
Source§impl Bvh
impl Bvh
Sourcepub fn point_candidates_bounded(
&self,
point: [f64; 3],
radius: f64,
out: &mut Vec<u32>,
remaining: &mut usize,
) -> Result<(), &'static str>
pub fn point_candidates_bounded( &self, point: [f64; 3], radius: f64, out: &mut Vec<u32>, remaining: &mut usize, ) -> Result<(), &'static str>
Conservative near-point candidates using this same tree/padding policy,
charging every visited node to a caller-owned aggregate work budget.
On exhaustion discard out: a partial candidate list is not a result.
Source§impl Bvh
impl Bvh
Sourcepub fn ray_candidates_bounded(
&self,
p: [f64; 3],
far: [f64; 3],
out: &mut Vec<u32>,
remaining: &mut usize,
) -> Result<(), &'static str>
pub fn ray_candidates_bounded( &self, p: [f64; 3], far: [f64; 3], out: &mut Vec<u32>, remaining: &mut usize, ) -> Result<(), &'static str>
Conservative candidates for the segment p→far, charging every visited
node to the caller’s aggregate work budget like point_candidates_bounded.
On exhaustion discard out: a partial candidate list is not a result.
Source§impl Bvh
impl Bvh
Sourcepub fn nearest_point_bounded(
&self,
point: [f64; 3],
radius: f64,
remaining: &mut usize,
ambiguity: f64,
candidates: &mut Vec<(u32, f64)>,
distance_squared: impl FnMut(u32) -> f64,
) -> Result<Option<(u32, f64)>, &'static str>
pub fn nearest_point_bounded( &self, point: [f64; 3], radius: f64, remaining: &mut usize, ambiguity: f64, candidates: &mut Vec<(u32, f64)>, distance_squared: impl FnMut(u32) -> f64, ) -> Result<Option<(u32, f64)>, &'static str>
Nearest leaf within a finite radius, visiting the nearer child first and shrinking the conservative query radius after each exact leaf distance. Retains candidates in the final nearest-distance plus ambiguity band; their exact distances let the caller reject near ties without a second walk. The callback must return the squared distance to that leaf’s primitive. Equal distances retain the original left-to-right candidate order. Every node and callback consumes the caller’s aggregate work budget; exhaustion returns an error, never a partial nearest result.
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 UnwindSafe for Bvh
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.