Skip to content

Commit

Permalink
Docs svenstaro#134 - acknowledge best-effort nature of dist traversal
Browse files Browse the repository at this point in the history
  • Loading branch information
finnbear committed Jan 10, 2025
1 parent 23cb5fe commit 6d5b557
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/bvh/bvh_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ impl<T: BHValue, const D: usize> Bvh<T, D> {
/// Returns a subset of [`shape`], in which the [`Aabb`]s of the elements were hit by [`Ray`].
/// Return in order from nearest to farthest for ray.
///
/// This is a best-effort function that orders interior parent nodes before ordering child
/// nodes, so the output is not necessarily perfectly sorted.
///
/// [`Bvh`]: struct.Bvh.html
/// [`Aabb`]: ../aabb/struct.AABB.html
///
Expand All @@ -148,6 +151,9 @@ impl<T: BHValue, const D: usize> Bvh<T, D> {
/// Returns a subset of [`Shape`], in which the [`Aabb`]s of the elements were hit by [`Ray`].
/// Return in order from farthest to nearest for ray.
///
/// This is a best-effort function that orders interior parent nodes before ordering child
/// nodes, so the output is not necessarily perfectly sorted.
///
/// [`Bvh`]: struct.Bvh.html
/// [`Aabb`]: ../aabb/struct.AABB.html
///
Expand Down
5 changes: 4 additions & 1 deletion src/bvh/distance_traverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ enum RestChild {
}

/// Iterator to traverse a [`Bvh`] in order from nearest [`Aabb`] to farthest for [`Ray`],
/// without memory allocations
/// or vice versa, without memory allocations.
///
/// This is a best-effort iterator that orders interior parent nodes before ordering child
/// nodes, so the output is not necessarily perfectly sorted.
pub struct DistanceTraverseIterator<
'bvh,
'shape,
Expand Down

0 comments on commit 6d5b557

Please sign in to comment.